Missy Franklin, a five-time Olympic gold medalist and two-time FINA World Swimmer of the Year, announced her retirement from swimming Wednesday in an article posted on ESPN.com.

Franklin, 23, whose four gold medals and outgoing personality made her the darling of the 2012 London Olympics, cited chronic shoulder pain she has battled since April 2016 as the impetus for her decision.

"It took me a long time to say the words, 'I am retiring,'" Franklin wrote. "A long, long time. But now I'm ready. I'm ready to not be in pain every day. I'm ready to become a wife, one day a mother. I'm ready to continue growing each and every day to be the best person and role model I can be. I'm ready for the rest of my life."

In London, the 17-year-old Franklin became the first American woman to win four golds in a single Olympics in any sport. She followed that performance by winning six gold medals at the 2013 World Aquatics Championships in Barcelona. There was talk of Franklin dominating the sport the way Michael Phelps ruled men's swimming -- no one could have predicted they would be the last individual gold medals of Franklin's career.

After Barcelona, Franklin turned down the opportunity to cash in on her success by turning professional and instead chose to attend the University of California-Berkeley and compete for the Golden Bears. There she was part of the team that won the 2015 NCAA championship. But she also faced the first significant obstacle of her career, battling a nagging back injury.

Franklin failed to win an individual gold at the 2014 Pan Pacific Championships or 2015 World Championships, but turned professional before the Rio Olympics and returned home to Colorado to swim for her youth coach, Todd Schmitz. Expectations were high; the demands on Franklin's time were even greater. Four months before Rio, she withdrew from a Pro Swim Series meet with "intense" shoulder pain. Though publicly she stayed positive, Franklin would later reveal she was also battling depression, anxiety and insomnia at the time.

"I'm ready to not be in pain every day. I'm ready to become a wife, one day a mother. I'm ready to continue growing each and every day to be the best person and role model I can be. I'm ready for the rest of my life." Missy Franklin

In Rio, the physical and emotional challenges hampered Franklin's performance. She failed to qualify for the finals in either of the two individual events she had qualified for: the 200-meter freestyle and the 200 back. She won her only medal, a gold, by swimming the preliminary heat of the 4x200-meter freestyle relay. She was not one of the four Americans who stood atop the medal podium after the U.S. won the final.

"Looking back, surviving through those eight days in Rio was the greatest accomplishment of my career," Franklin wrote in her retirement letter. "I was able to stay true to who I was as much in failure and disappointment as I had in winning and being the best in the world."

Added Schmitz: "I can tell you she handled it better than I did. When you think about her age, the pressure, she handled herself so unbelievably professional. When she got done you could tell she was emotionally spent. But I think in time she's really put it all into perspective."

Doctors diagnosed Franklin with severe chronic tendinitis of the rotator cuff and biceps. She underwent surgery on both of her shoulders in January and February 2017. But the pain never permanently subsided. She tried a change of scenery, in early 2018 enrolling at the University of Georgia to swim for respected coach Jack Bauerle. She endured three rounds of cortisone shots, including one before the U.S. nationals this past July, but she was never able to regain the form she showed in London as a teenager six years earlier.

"Maybe her career wasn't as long as we would have wanted and maybe it wasn't the destination we thought, but when you think about five Olympic gold medals in two different Olympics, that ranks up there with some of the best," Schmitz said. "You have to keep the big picture in perspective. For three years she caught lightning in a bottle. Most athletes spend the majority of their careers searching for that sweet spot."

In what would turn out to be the last race of her career, Franklin finished third in the "C" final of the 200-meter freestyle at the U.S. National Championships in Irvine in July. Her time of 1:59.15 was more than four seconds off her personal best in 2013. Afterward, an emotional Franklin gave no indication it might be the end, instead insisting she would do everything she could to try to earn a spot on the 2020 Olympic team at trials in Omaha, Nebraska.

"I would 100 times rather be in Omaha in 2020 having not made the team [but] knowing I tried everything I could, than looking back on these two years thinking, 'What if?'" Franklin said that night. "No matter what happens ... I'm going to fight my ass off. That's what I'm going to be most proud of. And that's going to define who I am."

Those plans changed when the pain in Franklin's shoulder persisted and doctors told her the only recourse was another surgery -- a procedure she said her doctors couldn't guarantee would even work. She discussed the decision with her fiancé, former Texas swimmer Hayes Johnson, and came to realize it wasn't worth it. There's more to life than swimming. It's time to move on.

She retires as the current world record holder in the 200-meter backstroke (2:04.06) and the winner of 27 medals in international competition.

"This is by no means the end," Franklin wrote. "Rather, I choose to look at this as a new beginning. Swimming has been, and always will be, a big part of my life and I absolutely plan to stay involved in what I feel is the best sport in the world, just in a different way."