LONDON — The finale was a formality, more a coronation than a contest. Michael Phelps headed into retirement the only way imaginable — with another gold medal.
Reclaiming the lead with the trademark butterfly stroke he debuted in the Olympics as a 15-year-old in Sydney a dozen years ago, Phelps won the 18th gold of a mind-boggling career in the 4 x 100-meter medley relay Saturday.
‘‘I’ve been able to do everything that I wanted,’’ he said.
When it was done, Phelps hugged his teammates — Matt Grevers, Brendan Hansen, and Nathan Adrian — before heading off the deck for the final time in his suit. He waved to the crowd and smiled, clearly at peace with his decision to call it a career.
And what a career it was.
Phelps retires with twice as many golds as any other Olympian, and his total of 22 medals is easily the best mark, too. He can be quite proud of his final Olympics as well, even though there were times he had trouble staying motivated after winning a record eight gold medals at the Beijing Games four years ago.
The 27-year-old could surely swim on for another Olympics, maybe two, but there’s really no point.
‘‘I told myself I never want to swim when I’m 30,’’ Phelps said. ‘‘No offense to those people who are 30, but that was something I always said to myself, and that would be in three years. I just don’t want to swim for those three years.’’
He hugged his longtime coach, Bob Bowman, who whispered three words that said it all, ‘‘I love you.’’ Their partnership was formed 16 years ago, when Bowman took a gangly, hyperactive kid with an extraordinary gift and helped turn him into a swimmer the likes of which the world had never seen.
‘‘Bob and I have somehow managed to do every single thing,’’ Phelps said. ‘‘If you can say that about your career, there’s no need to move forward. Time for other things.’’
Bouncing back from a disappointing first race in London, a fourth-place finish in the 400 individual medley, Phelps wound up with more medals than any other swimmer at the Games: four golds and two silvers.
‘‘Honestly, the first race kind of took the pressure off,’’ Bowman said. ‘‘If it’s not going to go too well, we should at least have fun while we’re here. That helped us relax a little bit, then he started swimming well in the relays and he picked it up again.’’
Grevers had the Americans in front on the opening backstroke leg, but Kosuke Kitajima put Japan slightly ahead going against Hansen in the breaststroke. Not to worry, not with Phelps going next.
He surged through the water in the fly, handing off a lead of about a quarter of a second to Adrian for the freesytle anchor. The Americans won going away in 3 minutes, 29.35 seconds, just off their Olympic record from Beijing. Japan held on for silver in 3:31.26, with Australia taking the bronze in 3:31.68.
The US men had never lost the medley relay at the Olympics, and they weren’t about to on the final night of swimming at the Olympic Aquatics Centre, on the final night for such a momentous athlete.
How momentous? The governing body of swimming, FINA, summoned Phelps back to the deck for one more award — a silver trophy commemorating his standing as the most decorated Olympian ever. A fitting gesture, though a more appropriate color would have been gold.
Then, as if 22 medal ceremonies over the last three Olympics weren’t enough, Phelps made one more victory lap around the pool, even stopping off at the podium, climbing to the top step again and posing with his final award.
Phelps kept a journal during his final Olympics. He was asked what he would write in it on this day.
‘‘I could probably sum it up in a couple words — I did it,’’ he said. ‘‘I haven’t written too much this week. I’m kind of taking everything in.’’
One of the moments he’ll remember: All the swimmers from the other relay teams lining up to shake his hand behind the blocks once he was done.
‘‘It’s kind of cool,’’ Phelps said. ‘‘The best part of the Olympics is you have people coming from all over the world competing in the best sporting event ever. That’s just something you don’t see every day.’’
We may never see the likes of Phelps again.
Of course, he was peppered with questions about a possible comeback, in a year when Ian Thorpe and Janet Evans both failed in their attempts to make it back to the Olympics after long layoffs.
‘‘I don’t think so,’’ Bowman said. ‘‘We’ve had a great end to a great run and there’s not much more he can do. I guess if he finds after a few years he’s searching for something and thinks he can find it in swimming, he could look at it. But I don’t think he will. I think he’s ready to explore other things. He’s done all he can do here.’’
Phelps wasn’t the only star of the night. Missy Franklin capped off a brilliant Olympic debut by helping the US take gold in the women’s 400 medley relay — with a world-record time of 3:52.05, no less.
The 17-year-old Franklin, who will begin her senior year of high school when she gets back to Colorado, seems destined to be America’s new star in the post-Phelps era after taking four golds and a bronze while swimming seven events — the same number as Phelps.
A definite bit of symmetry there, though Franklin doubts anyone can ever replace Phelps.
‘‘I don’t think his shoes will ever be filled. They’re so huge,’’ Franklin said. ‘‘Hopefully I can make little paths next to him.’’
And let’s not forget Allison Schmitt, who won three golds, a silver, and a bronze.