The American swimming legend won the men's 100-metre butterfly on Friday, touching the wall in 51.21 seconds. South African Chad le Clos, who beat Phelps in the 200-metre butterfly three days ago, couldn't pull a come-from-behind victory this time.
Instead, le Clos tied for the silver medal with Russian Evgeny Korotyshkin as both swimmers finished with a time of 51.44.
This was Phelps' unprecedented 17th Olympic gold medal and 21st in total.
"I'm just happy that the last one was a win," Phelps said. "That's all I really wanted coming into the night."
On Thursday, Phelps became the first male swimmer to win the same event at three consecutive Olympics after winning the men's 200-metre individual medley — a feat he duplicated in the 100-metre butterfly.
Phelps and compatriot Missy Franklin, who won the women's 200 backstroke on Friday, are the first triple gold medallists of the London Games.
Phelps started in typical fashion, content to let the other swimmers dictate the pace.
After making the turn for home, Phelps made his trademark move. By the final 25 metres, he pulled away from le Clos and Korotyshkin.
Phelps can win one final gold medal. He's part of the U.S. men's 4x100 medley event, a race the Americans are heavy favourites to win on Saturday.
Franklin breaks 200m backstroke world record
Franklin, the American teenage sensation, set a world record in the 200m backstroke for her third gold and fourth medal overall at the London Olympics.
Franklin clocked 2 minutes, 4.06 seconds, 0.75 quicker than the mark set by Kirsty Coventry of Zimbabwe at the 2009 world championships in Rome in a now-banned bodysuit.
It was the seventh world record of the games.
"I can't believe what just happened," said Franklin, who had dedicated her Olympics to victims of the theatre shooting not far from her Colorado home. "In that last 25, I knew I was giving it everything I had because I couldn't feel my arms and legs and I was just trying to get my hand to the wall as fast I could."
Anastasia Zueva of Russia touched in 2:05.92 to take the silver medal and Elizabeth Beisel of the United States finished in 2:06.55 to take bronze.
American Ledecky upends Brit Adlington
American 15-year-old Katie Ledecky won the 800m freestyle event.
The youngest member of the U.S. swim team narrowly missed a world record in the grueling race, falling off pace on the last lap and finishing in 8:14.63 seconds.
Mireia Belmonte Garcia of Spain touched in 8:18.76 to take the silver medal and defending champion Rebecca Adlington of host Britain finished in 8:20.32 for bronze.
Adlington set the world record of 8:14.10 at the 2008 Beijing Games.
Frenchman wins 50m freestyle
Florent Manaudou of France won the 50m freestyle event, capturing the final individual swimming medal of Friday's action.
The brother of former 400 free champion Laure Manaudou clocked 21.34 in the one-lap race. It was France's fourth swimming gold of the games.
Cullen Jones of the United States touched in 21.54 to take the silver medal and defending Olympic and world champion Cesar Cielo of Brazil finished in 21.59 to take bronze.
- Victoria's Ryan Cochrane won his heat to qualify for the final of the men's 1,500m freestyle. Cochrane earned a bronze medal at the Beijing Olympics.
- Sinead Russell, of Burlington, Ont., finished 8th in the women's 200m backstroke final.
- Montreal's Victoria Poon finished fifth in her semifinal heat of the women's 50m freestyle and failed to qualify for the final.
- The men's 4x100m medley relay team (Charles Francis, Cowansville, Que., Scott Dickens, Ancaster, Ont., Joe Bartoch, London, Ont., and Brent Hayden, Mission, B.C.) finished fourth its heat and qualified for the final.
- The women's 4x100m medley relay team (Julia Wilkinson, Stratford, Ont., Tera van Beilen, Oakville, Ont., Katerine Savard, Cap-Rouge, Que., and Samantha Cheverton, Lachine, Que.) finished sixth in its heat and failed to qualify for the final.