American Michael Phelps won the 18th and final Olympic gold medal of his career with a win in the 4x100 meters medley relay, before heading into retirement.
The 27-year-old swam the third butterfly leg at London's Aquatics Centre to help the United States past Japan in three minutes 29.35 seconds.
Phelps ends his career with 22 medals in total, 18 of them gold, from four Olympic Games.
Phelps made his Olympic debut in Sydney in 2000 as a 15-year-old and won six golds and two bronze medals in Athens, followed by an historic eight gold medals in Beijing.
After his final race the American was awarded with a trophy by swimming's world governing body, Fina, confirming Phelps's status as the 'greatest Olympic athlete of all time.'
The swimmer used the opportunity to thank his coach of 15-years Bob Bowman.