Michael Phelps of the United States won the Olympic 200 metres individual medley on Thursday to capture the 22nd gold medal of his career and become the first swimmer to win the same event at four consecutive Games.
Japan's Kosuke Hagino won silver and Wang Shun of China took bronze, both moving dramatically through the field on the final length after turning in fifth and seventh place.
It was yet another extraordinary swim for Phelps, 31, who has now won two individual and two relay golds at his fifth Olympics, two years after coming out of retirement.
His total medal haul has now risen to 26, including two silvers and two bronzes, with the 100 metres butterfly still to come.
He was lauded by the Rio crowd with one banner proclaiming "Phelps Greatest Olympian Ever" and Phelps swayed slightly and breathed deeply as he listened to the US anthem at the victory ceremony with his eyes moist.
He then raised his arms to salute the crowd as fiancee Nicole cradled their baby son Boomer in the stands.
There was little time to savor the moment, however, as he raced back off the pool deck to get ready for the semi-finals of the 100m butterfly, which he also has the chance to win for a fourth successive Games.
He finished second in his semi-final to qualify fifth fastest for Friday's final.
In the medley, Brazil's Thiago Pereira went off fastest, leading from Phelps after the butterfly leg, with Ryan Lochte of the United States and Hagino neck-and-neck just behind.
With the Rio crowd's excitement mounting, the three turned almost together after the backstroke, with Lochte just 0.01 seconds ahead.
Phelps led from Pereira and Lochte at the final turn and powered on as the other two faded, opening the way for Hagino and Wang to grab the two other medals.
Phelps clocked one minute, 54.66 for a comfortable winning margin of 1.95 seconds.
Japan's Hiromasa Fujimori was fourth and Lochte fifth in his last individual race of his long career, with a flagging Pereira seventh.
Phelps' four consecutive golds in the same event are unique for a swimmer, and place him in the same Olympic pantheon as fellow-Americans Al Oerter in the discus and Carl Lewis in the long jump.