It couldn’t have been scripted any better. The last day of swimming at the 2016 Rio Olympics was also the final day of competition for the most decorated Olympian of all time. The week has been building to this, the coda to Michael Phelps’ history-making, precedent-setting, record-smashing career.

Before it was over, however, others had their turn. In the punishing 1,500m, the longest distance in the Olympics, Italy’s Gregorio Paltrinieri won his country’s first swimming gold, while his countryman Gabriele Detti took bronze. American Connor Jaeger wedged the U.S. onto the podium with silver.

In the mad dash of the women’s 50m freestyle, an ebullient Pernille Blume of Denmark won gold, while American Simone Manuel continued her stellar run in Rio with silver. Aliaksandra Herasimenia of Belarus took bronze.

In the women’s 4 X 100 medley relay, the U.S. trailed Russia early, but Dana Vollmer pulled away during the butterfly leg and they never relinquished the lead. The U.S. easily won gold, followed by Australia with the silver and Denmark with the bronze. The U.S. has only lost this event five times since 1960 Games, and Kathleen Baker, Lilly King, Vollmer and Manuel made sure they checked another off in the win column. All members of the team earned medals in Rio.

Then it was the men’s turn. Phelps has always been partial to relays, which are a rare chance for him to share the weight with three other teammates. The medley in particular is a favorite since it brings him together with America’s best in each stroke. And it doesn’t hurt that the U.S. men own this event, having won the relay in every Olympics except for the Games they boycotted in 1980.

(Read More: Michael Phelps Has Won More Gold Medals Than 56 Countries)

In the final race of the evening, Ryan Murphy gave the U.S. a huge lead with a record pace backstroke. Cody Miller took over for the breaststroke before giving way to Phelps for the butterfly, who retook the lead from Great Britain. He handed over to Nathan Adrian, who earned bronze medals in the 100m and 50m freestyle in Rio, for the final leg. Adrian took it home safely, giving the U.S.-and its biggest star–the final swimming gold of the 2016 Olympics. The Brits hung on for silver, while Australia took bronze.

“It was the cherry on top of the cake that I wanted,” Phelps said afterward.

‘Feel Like a Kid Again’

The win gave the U.S. 33 swimming medals in Rio, topping its previous record of 31 set in 2000 and matched in 2012. It also tidea the previous tally for golds, 16, set in London. But the numbers only tell half the story; 15 of the Rio medals were won by Olympic rookies in individual events, including golds by Manuel in the 100m freestyle, by Maya DiRado in the 200m backstroke, by King in the 100m breaststroke and by Murphy in the 200m backstroke.

Phelps said winning alongside teammates was a fitting way to end his storied career. “Just walking into the pool tonight I think everything really started just coming out, the emotions started surfacing,” he said after his final race. “Walking down to the warm up pool deck I started to get choked up just thinking, ‘that’s it.'”

There’s a visible sense of comfort in Phelps that wasn’t there yet in 2000 when he made his first Olympic team, that was impossible to achieve in 2008 under the strain of outsize expectations, and was abandoned in 2012, when the transition away from life as a professional athlete consumed and nearly destroyed him. It’s all a reflection of the seismic shifts that have occurred in his life outside the pool, which fueled his comeback from retirement and helped him to, as he said, “feel like a kid again.”

You can see it in the smiles that come more easily and the emotions he exposed like a raw nerve on the medals stand in Rio. It’s there in the way he jokes more easily and engages more comfortably with fans, reporters, anyone who wants to merge orbits with the Greatest Olympian of All Time. And you see it in the way he lingers during his victory walks around the pool deck, savoring the cheers and soaking in the tributes showered in his direction.

Since the last Olympics, Phelps got lost and found himself again. He was arrested for DUI and entered rehab, where he finally addressed the issues that were keeping him from embracing what were supposed to be his glory days, the time when he reaped the rewards of his years of sacrifice. He worked on repairing his relationship with his estranged father, whom he had blamed for divorcing his mother and leaving when he was nine. As a new father himself, to three-month-old Boomer, he’s beginning to understand what being a parent means, and starting to see what a future, this time with a family of his own creation, can mean. Facing a life beyond the confines of a 50m pool, he has a clearer sense of who he is and what he wants from that life. “I’m really looking forward to seeing Boomer, [my fiancee] Nicole and my family; I’d just like to spend some time with them,” Phelps said in Rio–a point he has been repeating some version of throughout the week.

‘I Had A Blast’



“I’ve been able to do everything I ever put my mind to [doing] in the sport,” Phelps said. “I’ve had 24 years in this sport and I’m happy with how things finished. When I came back after 2012 I didn’t want to have ‘what ifs’ 20 years later. Being able to close the door on this sport how I wanted to — that’s why I’m happy now.”

Although Phelps’ relay teammates goaded him to hang on for the Tokyo Olympics in 2020 after the race, he insisted he’s at peace with calling it a career. “Just being able to finish this way is special because now I’m able to start the next chapter in my life,” he said. “This is just the start of something new.”

Phelps’ absence will be felt. Although the U.S. proved in Rio that the future is bright, Phelps has been the quadrennial push to give swimming at least a chance in fighting for the coverage and revenues of vastly more popular sports in the U.S. Since 2000, roughly the start of Phelps’ swimming career, the number of year-round swimmers in USA Swimming clubs steadily increased, from 221,000 to 337,000 last year.

“He has completely changed the sport of swimming,” said his teammate Adrian after their final race together. “He’s influenced the entire Olympic movement. It’s so incredible everything he’s done, especially who he’s shown himself to be as a person, how genuine he’s been through the whole process. I couldn’t respect him more for it.”

And at his fifth Olympics, Phelps has had a chance to see the effect he’s had on his sport in sharp relief. Freestyle phenom Katie Ledecky, whose world-record smashing habit is reminiscent of Phelps’, was inspired by him as a young swimmer. Others in Rio told their own Phelps stories, all with a familiar message about how they watched his career and used it as motivation to fuel their own dreams in the pool. And it came full circle in Phelps’ last individual race. In the 100 butterfly, he was bested by a 21 year old Singaporean who met Phelps as an eight-year-old. “I wanted to be like him, he was so victorious and I wanted to win,” says Joseph Schooling. “I don’t think I would be at this point without Michael; he is the reason I wanted to be a better swimmer.”

Phelps has relished watching the generation he inspired thrive in Rio. “Daring kids to dream — that’s the only reason why I’m here,” he said. “I was a little kid with a dream, which turned into a couple of medals and a pretty good couple years of swimming. I had a blast.”

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Contact us at letters@time.com.