The knee injury that sparked Shawn Johnson's comeback put an end to it, too.

The Olympic gold medalist announced her retirement Sunday, saying repeated setbacks with her left knee made contending for a spot at the London Games impossible, and left her fearful she was putting her long-term health at risk.

"It just little by little gets worse and worse," Johnson told The Associated Press. "My body is to the point where I need time to rest and retire so I can be healthy for the rest of my life. It's hard to wrap my mind around. Gymnastics has been my entire life, and now it's no more."

Her announcement, four days before the start of the U.S. gymnastics championships, brings a melancholy close to a career that took her from Iowa to Hollywood, with a few world titles, a trip to Beijing and an Olympic gold medal sprinkled in between.

"It's just been a fun road with Shawn," USA Gymnastics president Steve Penny said.

After winning four medals at the 2008 Games -- only Michael Phelps, Natalie Coughlin and Nastia Liukin left Beijing with more -- Johnson took the next two years off. She won "Dancing with the Stars" and, with her bubbly personality and girl-next-door looks, became a bona fide celebrity. She left the door open to a return for a London, but it wasn't until she blew out her knee in a January 2010 ski accident that she realized she still wanted to compete. Her first stop after the doctor's office was her gym, where she and coach Liang Chow began plotting her comeback.

The long layoff would present enough of a challenge, but her knee made it that much more difficult. She had torn the ACL, MCL and meniscus, along with her hamstring, and it never returned to full strength. She made the team for last year's Pan American Games, where she helped the Americans win the team gold. But when she tried to increase her training over the last few months to get ready for London, her knee would not cooperate. She couldn't do the number of repetitions she needed, and there were days she couldn't even work out because the knee would be so swollen.

"That was a hard, hard thing," Chow said of watching Johnson struggle.

Finally, Chow sat Johnson down and said they needed to be realistic. She couldn't put in the training she needed, and she was looking at an entire knee reconstruction if she kept going.