It was an action-packed day that also saw Roger Federer and Serena Williams advance to the finals at Wimbledon, while 80,000 people crammed into the Olympic stadium to cheer on a British athlete on the opening morning of athletics.
Phelps won the 100-metre butterfly ahead of Chad le Clos of South Africa, who had edged him in the 200 fly earlier in the week.
"I'm just happy that the last one was a win," said Phelps, who increased his career overall medal total to 21. "That's all I really wanted coming into the night."
He has the chance to add one more on Saturday night, when he swims the final race of his career, the 4x100 medley relay.
As Phelps neared the end of his career, two teenagers showed that the future of American swimming is in good hands.
Seventeen-year-old Missy Franklin set a world record in the 200 backstroke, for her third gold of the games. Later, 15-year-old Katie Ledecky nearly broke the world record to win gold in the 800 freestyle, denying Britain's Rebecca Adlington a repeat before her home fans. Adlington settled for bronze.
In tennis, Federer outlasted Juan Martin Del Potro of Argentina 3-6, 7-6 (5), 19-17 in 4 hours, 26 minutes. His victory set up a repeat of last month's Wimbledon final as No. 3 Andy Murray of Britain beat No. 2 Novak Djokovic of Serbia 7-5, 7-5.
A four-time Olympian, Federer clinched at least a silver medal. In 2008, Federer and Swiss teammate Stanislas Wawrinka won the gold in doubles.
Serena Williams also clinched her first Olympic singles medal, beating No. 1-seeded Victoria Azarenka 6-1, 6-2. On Saturday, Williams will face first-time Olympian Maria Sharapova, who beat Russian teammate Maria Kirilenko in the semifinals, 6-2, 6-3.
The games' first athletics finals featured two champions successfully defending the titles they won four years ago.
Ethiopia's Tirunesh Dibaba added another 10,000-metre Olympic title and further established herself as the greatest female long-distance runner in history, while in the shot put, Poland's Tomasz Majewski became the first repeat Olympic champion in 56 years, beating world champion David Storl.
Earlier, British heptathlete Jessica Ennis didn't disappoint the capacity crowd who got up early to pack the Olympic stadium. Minutes into the morning program, Ennis broke the British record for the 100-metre hurdles, clocking 12.54 seconds, the fastest time ever recorded for the hurdles in the seven-discipline event.
Thousands of flag-waving fans gave Ennis a huge ovation when she was introduced for the last heat of the opening event. She improved on the 12.62 run by Eunice Barber of France in 2005.
In news off the competition field, Russian track cyclist Victoria Baranova was expelled from the games after failing a pre-Olympics doping test. A spokesman for the governing body of the sport told The Associated Press that Baranova tested positive for testosterone July 24 in Belarus.
And an Australian rower has been sent home after damaging two shopfront windows outside London, but he won't be charged by police over the alcohol-related incident. The Australian Olympic Committee said Friday that Josh Booth, a member of the eight team which finished last in Wednesday's final, had apologized to two shop owners and would pay 1,400 pounds ($2,175) to repair windows broken in the incident.
On the second day of track cycling, Britain broke its own world record to win its second straight Olympic team pursuit gold medal. Edward Clancy, Geraint Thomas, Steven Burke and Peter Kennaugh tore over the pine wood of the London Velodrome to finish in 3 minutes, 51.659 seconds, lowering the mark of 3:52.499 they set during qualifying the previous day by nearly a second. The Australian team finished in 3:54.581 to claim the silver medal. New Zealand beat Russia to earn its second straight Olympic bronze.
Victoria Pendleton of Britain, broken-hearted on Thursday when disqualified from the women's team sprint, made up for it by winning a gold medal in women's keirin.
The rowing basin at Windsor west of London provided the bulk of early medals and New Zealand rowers were the stars, winning two of four races.
Hamish Bond and Eric Murray won the men's pair and Mahe Drysdale took the men's single sculls for the Kiwis, their third gold of the games overall — all of them in rowing.
"Four hundred and fifty grams of grit, attitude, determination and belief we could do it," Murray said as he held his gold medal in his hand.
Britain's Katherine Grainger captured her first Olympic gold on her fourth attempt, winning the women's double sculls with Anna Watkins. Germany beat favoured Croatia to win the men's quadruple sculls.
In other finals, Chinese trampolinist Dong Dong captured the men's Olympic title on Friday, posting a score of 62.990 to give him a gold medal to go with the bronze he won in Beijing four years ago.
Top-ranked Zhang Nan and Zhao Yunlei beat No. 2 Xu Chen and Ma Jin 21-11, 21-17 in the all-Chinese gold medal final of badminton mixed doubles.
In men's singles, Lin Dan and Lee Chong Wei powered through their semifinals on Friday to meet for the gold medal again. Lin ran over Lee Hyun-il of South Korea 21-12, 21-10, and No. 2-ranked Chong beat No. 3 Chen Long of China 21-13, 21-14.
At the Olympic range, Sergei Martynov of Belarus set a world record in the men's 50-metre rifle prone as he won the gold medal he had been looking for at six games.
Leuris Pupo of Cuba won the first major championship of his career by earning gold in the 25-metre rapid fire pistol. Pupo, whose only previous victory came at a World Cup event in Buenos Aires in 1998, scored 34 shots in the final to beat silver medallist Vijay Kumar of India by four shots.