Michael Phelps secured gold in his last individual event before retiring, winning the men's 100m butterfly.
The 27-year-old American's late surge gave him his third gold medal of London 2012 and the 21st Olympic medal of his career.
South Africa's Chad Le Clos and Evgeny Korotyshkin both touched the wall at the same time to tie for silver.
"It was a good way to finish my last individual swim ever," said Phelps.
"I didn't have a good finish and didn't have a good turn but I am just happy to defend that title."
Phelps, who won his first individual gold medal by beating Ryan Lochte in the 200m individual medley, now has five medals from these Games.