In front of a packed and deafening crowd, expectant for Rebecca Adlington's appearance in the 800m freestyle, the race immediately following his own, Phelps started badly and lagged dangerously in the first half of the race, but swam a remarkable final 50m to come from seventh at the turn to win the race in 51.21sec.
As befits almost the final lap of an extraordinary career, it was an extraordinary finish, concluding with a dead heat for silver between South Africa's Chad le Clos and the Russian Yevgeny Korotyshkin, both of whom touched the wall in precisely 51.44, as well as a dead heat for fourth, between the German swimmer Steffen Deibler and Milorad Cavic of Serbia, whom Phelps had narrowly beaten in the same event in Beijing, each in 51.81.
Phelps has said he will not race again after these Games, meaning that his performance on Saturday night in the final of the 4x100m medley relay will be his last ever competitive appearance in a swimming pool.
"I didn't have a good finish and didn't have a good turn but I am just happy to defend that title," he said immediately after emerging from the pool. "It's a good way to finish my last individual swim ever."
The win brings Phelps's medal tally from the Games to three golds and two silvers from six events, having earlier won the 200m individual medley and 4x200m freestyle relay. The swimmer, who claimed a record eight swimming golds in Beijing four years ago, had entered only seven events in London, but failed to win a medal in his first race, the 400m individual medley.
Earlier, the Aquatics Centre had witnessed the American teenager Missy Franklin win her third gold of the Games in the 200m backstroke in a world record time of 2.04.06. Britain's Lizzy Simmonds just missed out on the medals, finishing fourth in a time of 2.07.26, behind Anastasia Zueva of Russia, who took silver, and the USA's Elizabeth Beisel.
For the 17-year-old Franklin, who has already won 100m backstroke and 4x200m freestyle golds as well as a bronze in the 4x100m freestyle relay, descriptions of her as "the female Phelps", inheriting the mantle of her compatriot, seem ever more inevitable.
By his own stratospheric standards, Phelps's Olympics had begun with a disappointment and continued, for a time, to be merely excellent. After the shock of the 400m individual medley on the first day of the Games, in which his overhyped "duel" with his compatriot Ryan Lochte finished with Phelps without a medal for the first time in an Olympic final since 2000, he could manage only a silver the following evening, when a storming French foursome stole the 4x100m relay from USA's squad in the final moments of the race.
The following day, in what was supposed to be his very best event, the 200m butterfly, he was pipped to the line behind South Africa's Le Clos, having to console himself with another silver. That he had just equalled the record for the greatest number of Olympic medals in history, at 18, was almost incidental.
He would surpass Larisa Latinyna, the Soviet gymnast who had previously held the record, only an hour later, and his 19th Olympic medal, this time, was also his 15th gold. Another gold followed on Thursday, when he pipped Lochte on the line to win the 200m individual medley. It was as if the great swimmer had realised, at last, quite how limited were his remaining opportunities to show quite what he could do.
In an Aquatics Centre that has roared itself hoarse all week at the appearance of any Briton, Phelps's reception in every swim has been scarcely less rapturous. He received a personal phone call from Barack Obama, he revealed on Thursday, telling reporters: "The craziest thing was just when I answered the phone and they were like: 'Michael?' And I said: 'Yes.' "And they said: 'Please hold for the president of the United States' and I was, like, 'OK!'"
Obama had told him "how everyone is supporting me and is behind me at home, and how proud everyone is of me", Phelps said, before making him promise to tell his mother the president had said "Hi". "It was a good call."
The race brought a popular silver for Le Clos who, as well as claiming his first Olympic win in the 200m butterfly, had endeared himself to the world by bawling from the podium throughout the South African national anthem, even as his father Bert won over millions of BBC viewers in an infectiously effusive interview after his son's win.
Le Clos has been outspoken in his admiration for Phelps, describing him as "an inspiration and role model".
"I have all his major races on my computer," he said. "I think I have watched the 100m butterfly Beijing final, when he beat Cavic by 0.01sec, a million times. I have it in seven different languages."
Phelps, in response, has tipped the 20-year-old South African as having the talent to assume his dominant role in men's swimming. He had given the younger man some advice, it emerged, while the two posed for photographs immediately after Le Clos had beaten him to silver, telling him to "live the moment and enjoy it because it really is special".
guardian.co.uk © Guardian News and Media Limited 2010
image: © Marco PakÃ¶eningrat