Michael Phelps ends his incredible Olympic career on the perfect note winning his 18th gold medal is given a special reward to recognise the American as the most decorated Olympian in history.
Swimming the butterfly leg, the most decorated Olympian of all time went out as the ultimate winner when he joined forces with backstroker Matt Grevers, breaststroker Brendan Hansen and freestyler Nathan Adrian to crush their opponents and win the gold.
The four set a combined time of three minutes, 29.35 seconds, just outside the world record set by the Americans at the 2009 world championships in Rome, but it hardly mattered.
Japan finished second after leading at the halfway stage while Australia stormed home to collect the bronze but no country was ever going to stand in the way of an American team determined to give Phelps the send off he deserved.
The 27-year-old was swimming his last race before retiring after breaking every imaginable record during his career and providing a last memory of his determination to win.
The U.S. were ahead after the opening backstroke leg but slipped back to second following the breaststroke.
Then Phelps dived in for the last time and by the time he got back to handover to Adrian, the Americans were back in front and the result was a foregone conclusion.
In London, Phelps won four gold and two silver medals to finish his career with a total of 22 medals, four more than
Soviet gymnast Larisa Latynina, who held the previous record for almost half a century before Phelps set a new mark that could last even longer.
Phelps already had the record for the most gold medals.
By picking up his 18th, he finished his career with twice as many as the next best, the nine jointly held by Latynina, American athlete Carl Lewis, American swimmer Mark Spitz and Finnish distance runner Paavo Nurmi.
After collecting his final medal Phelps was also awarded a special trophy recognising him as the most decorated Olympian in history.
Men's 4x100m medley final results
1. United States
Matthew Grevers/Brendan Hansen/Michael Phelps/Nathan Adrian 3 minutes 29.35 seconds
Ryosuke Irie/Kosuke Kitajima/Takeshi Matsuda/Takuro Fujii 3:31.26
Hayden Stoeckel/Christian Sprenger/Matthew Targett/James Magnussen 3:31.58
Liam Tancock/Michael Jamieson/Michael Rock/Adam Brown 3:32.32
Laszlo Cseh/Daniel Gyurta/Bence Pulai/Dominik Kozma 3:33.02
Helge Meeuw/Christian Vom Lehn/Steffen Deibler/Markus Deibler 3:33.06
Nick Driebergen/Lennart Stekelenburg/Joeri Verlinden/Sebastiaan Verschuren 3:33.46
Charles Francis/Scott Dickens/Joe Bartoch/Brent Hayden 3:34.19