Friday's 100-meter butterfly marked Michael Phelps' final individual swim of the 2012 Olympics, but more significantly, it was his last individual medal race of his Olympic career.

Phelps has said repeatedly he will retire from competitive swimming after the London Games.

He went out in style, winning the gold medal with a time of 51.21 seconds for his record 21 Olympic medal and his fifth medal in London (three gold and two silver.)

In seventh place at the 50-meter mark, Phelps had to stage a comeback over the second half of the swim to narrowly beat out South Africa's Chad Le Clos and Russia's Evgeny Korotyshkin, who tied with a time of 51.44 seconds for silver. Serbia's Milorad Cavic and Germany's Steffen Deibler tied for fourth place.

Friday's 100m fly featured two different rematches for Phelps: Le Clos edged him out in the 200-meter butterfly in London and Phelps narrowly defeated Cavic in 2008.

At the Beijing Games, Phelps trailed Cavic until the very end, when he snuck in and touched the wall just a fraction of a second ahead of Cavic. The result ended with Phelps' now famous water-splashing celebration in the pool.

Phelps has one more swim left in his Olympic career. He will close out his legendary career Saturday in the men's 4x100-meter medley relay.