[Editor's note: Missy Franklin, a five-time Olympic gold medalist and two-time FINA World Swimmer of the Year, announced her retirement from the sport on Wednesday. In an exclusive letter she has shared with ESPN senior writer Wayne Drehs, Franklin explains why and how she came to her decision.]

In My Own Words: The Next Chapter

It is with tears in my eyes but a full heart that I begin typing this letter.

It's hard to know where to begin, but I feel confident and fulfilled in how it will end, and that's all I could ever ask for.

Swimming was my first true love. Being in the water gave me a sense of freedom, playfulness and joy. It was where I could be completely and utterly myself, not bound by any restrictions or limitations. It was where I found my first best friends, my first mentors and my first taste of competition. It is the little things I remember from the early days, like playing sharks and minnows on Friday morning after practice with my summer club team, the Heritage Green Gators, followed by Krispy Kreme doughnuts. It was doing relays with pumpkins on Halloween and turkey bowling at the practice before Thanksgiving. It was working so hard, every day, and loving every minute of it. It was learning time management, leadership and sportsmanship. It was achieving goals and relishing every moment.

People always ask me when I knew I was good, and I always tell them I truly don't know because all I was concerned with was having fun. I was just being a little girl, spending time with my teammates and closest friends at practice, all while still getting in a good laugh as we gasped for breath at the wall in between intervals. However, if I had to pick a moment, it would have been as a 13-year-old at 2008 Olympic Trials. I will never forget looking around on the pool deck and seeing every swimmer I had ever looked up to just five feet away from me. I will also never forget realizing that I had made it to the same meet they did, swimming in the same pool and fighting for the same dreams. I knew I wanted to be back at Trials in four years, and I wanted to be the one that the 13-year-olds looked up to on the pool deck.

The first 18 years of my career were as picture perfect as it can get. The equation couldn't have made more sense: you work hard, you have a positive attitude, you show up every day and give your best, and you get faster. That's how it worked for me. I worked harder, I trained harder and I swam faster, year after year after year. Following the 2012 Olympics, I decided to remain an amateur and swim in college, and it is one of the best decisions I have ever made. Swimming at the University of California, Berkeley was one of the greatest honors and privileges I've had as an athlete and a person. The teams I was able to be a part of in 2014 and 2015 taught me more than I can begin to say. People would sometimes laugh when I said I wanted to swim in college because I knew I would meet my future bridesmaids on my team and that they would become my family for life. Well, I did meet them. One maid of honor and three bridesmaids, to be exact.

In 2015, I decided to go home and train in Colorado with Todd Schmitz and the Colorado Stars, and work with my weight trainer Loren Landow. I've been very open about what I went through as I prepared for the Olympics in 2016 and talked openly about the struggles I endured, which included shoulder pain whenever I tried to train or compete, depression, anxiety and insomnia. It was also the year when I began to fully accept the fact that something was wrong with my body and it wasn't working the way it was supposed to work.

At the Mesa Pro Series event in April 2016, I had to be pulled from the meet due to intense shoulder pain from an injury suffered in warm-up. I had never experienced that kind of pain before and I began to completely unravel. The Olympic Games were just four months away and many expected it to be the greatest moment of my athletic career. After the success I saw at my first Olympics in London, the expectations for my second Olympic appearance only felt greater.

I trained through it all -- both the physical and emotional pain -- and did everything I possibly could have to keep my head held high. Looking back, surviving through those eight days in Rio was the greatest accomplishment of my career. I was able to stay true to who I was as much in failure and disappointment as I had been in winning and being the best in the world.

After I made it through the Olympics, I knew we had to finally address the pain that I had been using every ounce of energy to ignore. In January and February of 2017, I had surgery on my left and right shoulders. It should have been a quick recovery, but when I was back in the pool in April, I knew based on my pain level that I needed more time to heal. I took the summer off and ended up reconnecting with the man I will be marrying next year. I can't even begin to explain how God's timing works, but all I know is that it is beautiful, perfect and magical.

Chronic injuries to her shoulders was a large part of Missy Franklin's decision to retire from competitive swimming. Mark J. Rebilas/USA TODAY Sports

I got back to training in the fall with Dave Durden and the men's team at Berkeley. I still had physical therapy 2-3 times a week, and frequently had to adjust practices to compensate for the shoulder pain I was experiencing. I was beginning to get truly frustrated. Weren't the surgeries supposed to help? Wasn't this all supposed to go away? Wasn't I meant to fall in the love with the sport again?

I made the decision in December that I needed to put myself in a new and different environment. As hard as it would be to leave the people I loved so much in Northern California, I also knew I needed to try something different. I packed my bags and within two weeks was living in Athens, Ga., and training with Jack Bauerle at the University of Georgia. Jack and the team took me in with the most welcoming arms, and I began an entirely different kind of training than I was used to. I was so ready to begin my comeback, to prove everyone wrong, to show everyone what a fighter I was and to come back better than I had ever been. I truly believed I could do it, and I had the best people around be believing I could do it, too.

Unfortunately, it was also the same time that my shoulder pain became the worst I had ever experienced. I was still in physical therapy multiple times a week and my coaches were doing everything to help me just get through each practice. Every moment I wasn't training was spent recovering with ice and rest, as I tried to heal and prepare myself for the next practice - but nothing was working. I went through three different rounds of cortisone shots, one of which was before Nationals this past summer, and also had an ultrasound bicep tendon injection at the end of September. Technically speaking, my medical diagnosis is severe chronic tendonitis of both the rotator cuff and the bicep tendon. After the failure of my last round of shots, I had only one other option: another surgery, and even that was a long shot.

When I heard the word "surgery," I immediately broke down because I already knew my answer: no. I've been in too much pain, for too long, to go through another surgery with a longer recovery time and no guarantee it would even help. I prayed, and I prayed, and I prayed. I talked to the most trusted people in my life. When my now fiancé looked at me and said the following, my answer finally became clear. "I will support you fully, no matter what you choose. But what matters to me the most, more than anything, is that you can hold our children in your arms one day without being in excruciating pain."

I began to realize that my greatest dream in life, more so than Olympic gold, has always been becoming a mom. Swimming had been such a huge part of my life for as long as I could remember, but it was not my entire life. I still have dreams, goals, aspirations and intentions I plan on living out every day of my life. I will never be able to express in words how grateful I am for swimming -- for the places it has taken me, the lessons it has taught me and, most importantly, the people it has brought into my life.

To every teammate, every coach, every mentor, every meet official ... you have made me the person I am today, and it is a person I am incredibly proud to be.

For all the companies and brands I have worked with, especially Speedo, Coca-Cola, Minute Maid, Streamline Brands and the USA Swimming Foundation, you have become family and stayed by my side through every up and every down. Thank you for your unwavering support.

To my parents, my family and my dearest friends, who will forever be the most important people in my life, thank you for raising me, teaching me and inspiring me to be a strong woman who is brave and courageous enough to make this decision, and to support it with all your hearts.

This letter would become a novel (if it isn't one already) if I listed all the thank yous that are in my heart, but please know they are there and in abundance.

This is by no means the end. 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 believe is the best sport in the world, just in a different way. I hope to continue to inspire others to be their best, both in and out of the pool, and I'm truly excited about this next chapter and how my relationship with the sport will continue to change and grow.

It took me a long time to say the words, "I am retiring." 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 and, 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.

Thank you,

Missy