Maggie Nichols hadn't planned on being a spectator during the Pacific Rim Championships and the U.S. Classic last spring. When she tore the meniscus in her right knee, though, the Little Canada gymnast missed those two meets — filled with women hoping to make the U.S. Olympic team — and faced four to six weeks of rehabilitation.

Just because Nichols was sidelined didn't mean she was idle. Following an earlier knee surgery in 2014, she learned she could keep building strength and fitness while waiting for her injury to heal. Nichols followed the same strategy this time around, returning to the gym two days after arthroscopic surgery in April — which put her on course to return to competition this weekend, at the USA Gymnastics national championships in St. Louis.

The women's competition, which begins Friday, is the first step toward choosing the five athletes who will represent the U.S. at the Rio Games. The all-around champion at the Olympic trials July 8-10 will automatically qualify, and a selection committee will pick the other four members based on performances at the nationals and the trials.

This weekend's meet will be the first for Nichols since the American Cup in March, where she was the silver medalist in the all-around. Though she is training all four events, she will compete only on uneven bars and balance beam at the nationals.

"I took a couple of days off right after the surgery, because I wasn't allowed to walk around or do anything else, and I was supposed to keep my leg elevated,'' said Nichols, 18, who won gold in the team competition and bronze in floor exercise at the 2015 world championships. "Then I got right back into the gym, doing all the conditioning I could do with my upper body, just to stay in the best shape I could.

"It was pretty difficult watching [the Pacific Rim meet], just knowing I was supposed to be there helping out Team USA. It just wasn't meant to be. But my training is going really well now.''

Nichols, a member of the Twin City Twisters gym in Champlin, is among the favorites to make the Olympic team. She was runner-up in the all-around at last year's national championships and was the only U.S. athlete to do all four events during the team finals at last fall's world championships. Last summer, U.S. women's national team coordinator Martha Karolyi said Nichols had made "the biggest improvement'' of any U.S. gymnast in the period since the 2012 Olympics.

In early March, Nichols won the floor exercise and was second in the other three events at the American Cup. She was named to the U.S. team for the Pacific Rim Championships but had to withdraw after injuring her knee in a training session.

She responded the same way she did after dislocating her left kneecap in 2014. During a six-month rehab period after that injury, the strength and conditioning work Nichols put in gave her the foundation to do more difficult skills. That experience, she said, taught her how to maintain her physical condition this time around and stay on course toward the Olympic trials.

Nichols will not compete in her best event, floor exercise, or perform her Amanar vault at nationals. That will prevent her from challenging three-time world champion Simone Biles, 2012 Olympic gold medalist Gabby Douglas and U.S. Classic winner Aly Raisman for the all-around title, but she feels confident about her main goal: moving toward a place on the Olympic team.

"It's nearly impossible to not be nervous about it,'' Nichols said. "But it's also very exciting, knowing it's right around the corner and that it's actually a possibility. I just want to work as hard as I possibly can to achieve it.''