Tunisia's Oussama Mellouli shrugged off the after-effects of illness to become the first person to win Olympic swimming titles in pool and open water with victory in the 10km marathon on Friday.
The 28-year-old had been laid low by a virus earlier this week but recovered to plunge into the waters of the Serpentine at a sun-soaked Hyde Park and claim victory in 1hr 49min 55.1sec, 3.4sec in front of Germany's Thomas Lurz.
Richard Weinberger of Canada took the bronze medal, with world champion Spyridon Gianniotis of Greece finishing just outside the medals in fourth place, ahead of Great Britain's Daniel Fogg.
"In the last 300 to 400 metres, I basically went through Hell and came back to life," said Mellouli.
"My shoulders were getting so heavy, my legs were getting so tight, and my lungs were burning so much.
"I caught a virus 48 hours ago and couldn't be in the water, so to come back and do this is something quite miraculous."
Mellouli's victory represented yet another milestone for the pioneering 28-year-old.
In 2008 in Beijing, three months after returning from an 18-month doping ban, he became the first African man to win an Olympic gold swimming medal when he topped the podium in the 1500m freestyle.
He is the second man to have tasted victory in the Olympic open water swimming marathon, after Dutchman Maarten van der Weijden won the inaugural event in Beijing four years ago.
Mellouli also collected a bronze in the 1500m at these Games last weekend.
Signup to our newsletter and follow us on Facebook and Twitter!
"To do this kind of double is something that's never been done before, and in one of the toughest races," he said.
The Tunisian made the early running on a baking hot afternoon on the Serpentine lake, with a pack of swimmers assembling behind him to capitalise on the reduced water tension in his wake.
Weinberger had pulled ahead by the time the field reached the end of the first lap, with Mellouli second and Fogg third.
The pack condensed on lap two, and although Mellouli upped the pace again on the following lap, the swimmers remainded tightly bunched at the halfway stage.
Germany's Andreas Waschburger moved to the front of the field at the start of the fourth lap, and he led Weinberger by 1.8sec and Mellouli by 2.1sec with two laps remaining.
The big guns moved into position on lap five and as the final circuit of the lake began, Mellouli, Lurz, Gianniotis and Weinberger had broken away from the rest of the race.
Mellouli took the initiative once again on the sixth lap but although he had extended his lead to 13sec at one point, he faded badly in the final sprint and had to grit his teeth to beat Lurz to the finishing line.
"I think I swam a smart race, because I realised going into the last lap that it was really fast," said Lurz, a bronze-medallist in Beijing.
"I saved a lot of power for the silver medal because I knew that if I pushed too much, I'd end up fourth."
Friday's race was the final swimming event of the London Olympics.
The United States were already assured of finishing top of the swimming medals table, having accumulated 31 medals -- including 16 golds -- in the pool.