London (CNN) -- Michael Phelps added to his Olympic legend Friday night, winning the 100-meter butterfly to capture his third gold medal of the London Games and the 17th of his career.
Already the most decorated Olympian in history, Phelps started off Friday's race -- which he has said will be his final individual Olympic race, having promised to retire after this competition -- trailing several swimmers.
But with basketball great Lebron James and Prince William among those looking on, the Baltimore native charged ahead late to win by 0.23 seconds over South Africa's Chad le Clos and Russia's Evgeny Korotyshkin, who finished with an identical time.
That margin, while slim, was still exponentially larger than when Phelps captured gold in the same event at the 2008 Beijing Games. Phelps won that race by .01 seconds by taking a quick, final stroke to catch a Serbian swimmer gliding to the wall.
"This one was I guess a bigger margin than the last two, so a step in the right direction," Phelps told NBC after his latest win.
"It's a pretty cool feeling. I have had a great week so far, and we have one more race tomorrow," he added, referring to his final Olympic race Saturday as part of the U.S. men's 4X100-meter medley relay team.
Phelps wasn't the only American to make history in the pool Friday. Missy Franklin, 17, from Pasadena, California, earned her third gold medal, and fourth medal overall, in the women's 200-meter backstroke, smashing the world record in the process.
"It doesn't get any better than this," Franklin said to NBC about her victories in London. "This has been the most incredible week, and I've never been happier."
Another American teenager, 15-year-old Katie Ledecky, also earned gold in impressive fashion, besting her nearest competitor by more than four seconds in the women's 800-meter freestyle.
France's Florent Manaudou, 21, won the swimming competition's fastest and, arguably, most glamorous event with a time of 21.34 (just a shade off the Olympic record) in the men's 50-meter freestyle, his first ever Olympic final.
The United States' excellence at the Aquatics Centre helped them pass China for the most gold medals, with 21, on the seventh full day of the Games. The Americans have 43 medals total, compared with 42 for the Chinese.
Great Britain also rocketed up the medal count chart Friday, thanks to one of its athletes' best days yet. The host nation captured three gold medals, bringing its total for the Games to eight, just behind South Korea for the fourth most of any country.
The women's double sculls team of Anna Watkins and Katherine Grainger placed first in their competition, while the Brits excelled at the Velodrome for indoor cycling events.
The men's team pursuit title went to Great Britain, and in world record time. Then, a short time later, Victoria Pendleton eked out a win by fractions of a second over a fast-charging competitor from China in the women's keirin competition.
In tennis, Roger Federer of Switzerland advanced to the gold-medal match in men's singles, after beating Juan Martin Del Potro of Argentina in a marathon four-hour, 26-minute match.
The legendary player's final match doesn't promise to be much easier, considering that the London crowd most likely will be rooting against him. That's because Great Britain's own Andy Murray secured a spot in the championship, after beating hard-hitting Serbian Novak Djokovic by a 7-5, 7-5 score. Federer and Murray last matched up on the same court in July, when the 30-year-old Swiss won the Wimbledon final in straight sets despite the exhortations of the home crowd, which included several members of the royal family.
The women's final, meanwhile, will pit American Serena Williams and Russia's Maria Sharapova after the two won semifinal matches Friday in straight sets. Both women are no strangers to the All-England Club court: Sharapova has won the iconic Wimbledon tennis major once, while Williams has captured that championship five times, most recently just a few months ago.
The U.S. women's football (soccer) team also moved to the semifinal round with a 2-0 win over New Zealand. Still, the biggest match of the day showcased two of the sport's top teams in Brazil and Japan. Reigning World Cup champion Japan won 2-0 to advance to the next round.
In judo, 16-year-old Wojdan Shaherkani of Saudi Arabia was allowed to compete wearing a headscarf but lost in her elimination match Friday to Melissa Mojica of Puerto Rico in 82 seconds.
Officials initially said they would not allow her to compete in the headscarf, but Shaherkani's father and Saudi officials insisted that she would not compete without it.
Shaherkani, who was competing in her first major international event, received a special invitation to compete from the International Olympic Committee.
One of the most exciting contests Friday may have mattered little in the medal count, though it provided a historic amount of drama. The women's basketball teams from Great Britain and France finished their preliminary round game's regulation tied at 67, and the game looked set to go into a second overtime. But France's Celine Dumerc hit a three-point shot with a fraction of a second left to propel her team to victory.
And for the first time since the opening ceremony, Olympic Stadium was buzzing Friday with the start of track and field competition.
Athletes in action included American sprinter Allyson Felix, who won her first-round heat to move on to the semifinals of the 100-meter sprint. She raced a few weeks after she sprinted to a tie with Jeneba Tarmoh in the Olympic Trials. On the day of a scheduled runoff, Tarmoh -- who is part of the U.S. team as a member of the relay pool -- backed out.
Fellow American Carmelita Jeter posted the day's best time in that race at 10.83 seconds, a full tenth of a second better than her next fastest foe.
Most of the track and field events Friday were qualifiers, like the women's sprint, but a few medals were handed out.
Poland's Tomasz Majewski won gold in the shot put, just ahead of Germany's David Storl. America's Reese Hoffa was third.
And the women's 10,000-meter race ended with a climactic finish, as Ethiopia's Tirunesh Dibaba pulled away from a pair of Kenyan runners for the win.