U.S. Olympic swimmer Michael Phelps is celebrating after earning his 23rd gold medal Saturday night in the 4x100-meter medley relay. Phelps left Rio making history as the most decorated swimmer of all time.
"It turned out pretty cool," Phelps said after his final race. "It just the perfect way to finish."
As Phelps heads out of Rio, he walks away with five golds and one silver. No other Olympian has more than nine medals, Phelps has 28.
"I wouldn't change anything," he said. "This is the best place I've ever been in my life."
Just two years ago the gold winning medalist was in a much darker place. Phelps recently revealed that he suffered an identity crisis and wanted to end his life.
"I thought the world would just be better off without me," Phelps told ESPN. "I figured that was the best thing to do — just end my life."
After a second DUI arrest in 2014 and an image surfacing of Phelps smoking from a bong, he said he felt his reputation was ruined and there was no way he could bounce back from those mistakes.
"This is the end of my life... How many times will I mess up? Maybe the world would be better without me," Phelps remembered thinking.
But then Christian friend and NFL star Ray Lewis stepped with words of encouragement. Lewis, who made a comeback after a series legal troubles himself, told Phelps he could get his life on track.
"This is when we fight," he told Phelps at the time. "This is when real character shows up. Don't shut down. If you shut down we all lose."
The 23-time medal winner entered a psychological trauma and addiction treatment center in October in 2015. While he was there, Lewis sent Phelps a copy of Rick Warren's Purpose Driven Life.
Click play to hear Michael Phelps share how he got ready for his final race.
Phelps credits Warren's book for uplifting him and giving him hope again.
"It's turned me into believing there is a power greater than myself and there is a purpose for me on this planet … It helped me when I was in a place where I needed the most help," he said.
It affected him so deeply that Phelps would read the book to fellow patients, which earned him the nickname "Preacher Mike."
Warren responded to Phelps comments about the book in a Facebook post this week:
"I'm proud of @MichaelPhelps for his victories even before the Olympics begin. Excited he'll be carrying the flag for the U.S.," it read.
Phelps told NBC's "Today" that he can finally give 100 percent of himself at the Rio games and is excited about what the future holds.
"I'm happy to turn the page to the next chapter. I'm happy to move on from my swimming career and go out how I wanted to," he said.