By the time he retired at Rio 2016 at the age of 31, Michael Phelps had collected a total of 23 golds, three silvers and two bronzes at the Olympics, a record-breaking haul that looks unlikely to be bettered for many years to come.

The most decorated athlete of all at Rio 2016, where he won five golds and a silver, Phelps suffered attention deﬁcit/hyperactivity ­disorder as a child and was encouraged to take up swimming at the age of seven to control his energy. Over the years he developed into a champion swimmer, beating record after record in every age category in which he competed.

From Sydney to Athens

Phelps began to forge his Olympic legend at the age of 15, when he finished fifth in the 200m butterfly final at Sydney 2000. Reflecting on that achievement, the ever-demanding swimmer said: “It was great, I was fifth, that’s a pretty big accomplishment. But I didn’t want it. I wanted more. I was within half a second of medaling – it was literally, if I would have taken it out a little bit faster, maybe I would have had a chance.”

“There are reasons why I swam every holiday, every Christmas, every birthday,” added Phelps, explaining why he was the most dedicated of swimmers. “I was trying to be as prepared as I could, and I tried to see what I could really do and what my potential was. I just really did kind of whatever it took.”

Phelps had won five world titles by the time he opened his Olympic account at Athens 2004. Competing in eight events in the Greek capital, he took gold in the 100m and 200m butterfly, 200m and 400m individual medley and the 4x100m and 4x200m freestyle relays with his USA team-mates. He also won bronze in the 200m freestyle and the 4x100m freestyle relay.

His eight-medal haul matched the single Summer Games record set by Soviet gymnast Aleksandr Ditatyn, at Moscow 1980, while his tally of golds was only one fewer than the record seven won by his fellow countryman Mark Spitz, in the pool at Munich 1972.

“Everyone was comparing me to Mark Spitz. But for me – I still say this a lot – it was never about beating Mark Spitz,” Phelps later said. “It never was. It was about becoming the first Michael Phelps, not the second Mark Spitz. And that’s truly what I always dreamed of as a kid. I dreamed of doing something that no one had ever done before.”

Beijing eight

Another 12 titles came his way at the 2005 and 2007 FINA World Aquatics Championships, held in Montreal and Melbourne respectively, a sign of things to come at Beijing 2008, where he took gold in all eight events he contested. It was a feat unprecedented in any sport in the history of the Games.

In topping the podium in the 100m and 200m butterfly, 200m freestyle, 200m and 400m individual medleys and the 4x100m and 4x200m freestyle relays and the 4x100m medley relay, the voracious Phelps posted seven world records and an Olympic record in the 100m butterfly. His exploits in the Chinese capital made him the most decorated of all Olympians with 14 gold medals.

In the years that followed, the Bob Bowman prodigy became the most decorated swimmer in the history of the world championships, winning five more titles in Rome in 2009 and a further four in Shanghai two years later to take his Worlds medal collection to 33, 26 of them golds.

Four Games and out?

In making his fourth Olympic appearance at London 2012, where he announced his impending retirement, Phelps became the first male swimmer to win the 100m butterfly and 200m individual medley titles at three consecutive Games. As well as landing the 4x200m freestyle relay title, he took silver in the 200m butterfly and the 4x100m freestyle relay before claiming an 18th Olympic gold in the 4x100m medley.

Speaking after that final success, an emotional Phelps said: “It’s tough to put into words right now, but I finished my career how I wanted to. Through the ups and downs of my career I’ve still been able to do everything that I’ve ever wanted to accomplish. I’ve been able to do things that no-one else has ever been able to do and this is one of the funniest ways to finish it, in a relay.”

Phelps’ London exploits took his career tally of Olympic medals to a record 23, moving him past the previous best of 18, amassed by Soviet gymnast Larisa Latynina in the 1950s and 60s.

A rousing return

Despite having announced his retirement, Phelps could not resist the lure of the pool, and was back in training in April 2014, his sights set on Rio 2016. Turning in a typically brilliant performance at the U.S. Trials in Omaha in late June 2016, he qualified for three individual and three relay events.

Still the world-record holder for the 100m butterfly (49.82 seconds), 200m butterfly (1:51.51), 400m individual medley (4:03.84) and the 4x100m (3:08.24) and 4x200m freestyle (6:58.55) relays, the greatest swimmer of them all was in determined mood ahead of Rio 2016.

“I’m 31 years old and swimming faster than I ever have before,” he warned, letting everyone know that he was still hungry to add to his record tally of Olympic titles and medals.

Phelps began his Rio campaign by swimming a decisive second leg in the 4x100m freestyle relay, helping the USA win gold ahead of France and Australia, the 19th of his storied career. The 20th and 21st came within an hour of each other two days later, as he won the 200m butterfly title for the third time and the 4x200m freestyle for a fourth.

After the second of those victories, and having secured his status as one of the heroes of the Rio Games, he emerged from the water and sat on his starting block, soaking up the adulation of the crowd.

Two days later, he won the 200m medley for the fourth time in a row, joining compatriots Al Oerter (discus) and Carl Lewis (long jump) as the only athletes to have won the same individual event at four consecutive Games.

“This all started and began with one little dream as a kid to change the sport of swimming, try to do something nobody has ever done,” he said after making it gold number 22.

The following day he shared silver with close friends and rivals Chad Le Clos and Laszlo Cseh behind Singaporean youngster Joseph Schooling in the 100m butterfly.

“Chad and I have raced each other quite a few times in the last four years, and as for Laszlo and me, I can’t even remember the first time we competed against each other,” he said after securing a 27th Olympic medal. “So it’s kind of special, and a great way for me to finish my last individual race.”

Phelps’ last race of all came on 13 August, when he made a typically brilliant contribution to the USA’s victory in the 4x100m medley, swimming a superb butterfly leg en route to collecting his 23rd Olympic gold and 28th medal overall.

“Being able to close the door on this sport how I wanted to – that’s why I’m happy now,” Phelps said after completing his six-medal haul in Rio. “I was a little kid with a dream, which turned into a couple of medals. Just being able to finish this way is special because now I’m able to start the next chapter in my life.”

In December 2016, Phelps posed with every one of his Olympic medals for the magazine Sports Illustrated. In total they weighed eight kilograms, a staggering haul that will take some matching.