United States' Michael Phelps gestures on the podium after he was presented with the gold medal in the men's 100-meter butterfly swimming final Friday at the Aquatics Centre in the Olympic Park during the 2012 Summer Olympics in London. Phelps won for his 17th gold medal and 21st overall medal.

United States' Michael Phelps displays his gold medal in the men's 100-meter butterfly swimming final Friday at the Aquatics Centre in the Olympic Park during the 2012 Summer Olympics in London. Phelps won for his 17th gold medal and 21st overall medal.

United States' Michael Phelps, top, celebrates after winning the men's 100-meter butterfly swimming final, with United States' Tyler McGill beside him, in the men's 100-meter butterfly swimming final Friday at the Aquatics Centre in the Olympic Park during the 2012 Summer Olympics in London. Phelps won for his 17th gold medal and 21st overall medal.

United States' Michael Phelps take the start in the men's 100-meter butterfly swimming final Friday at the Aquatics Centre in the Olympic Park during the 2012 Summer Olympics in London. Phelps won for his 17th gold medal and 21st overall medal.

United States' Megan Rapinoe battles New Zealand's Ali Riley for possession during their quarterfinal women's soccer match Friday at the 2012 Summer Olympics at St. James' Park in Newcastle, England. The U.S. won, 2-0.

France's Teddy Riner competes with Russia's Alexander Mikhaylin in the gold medal match in the men's over 100-kilogram judo competition Friday at the 2012 Summer Olympics in London. Riner won to capture the gold medal.

United States' Jessica Steffens, left, sports a cut above her eye as she defends against China's Sun Yating during their women's water polo preliminary round match Friday at the 2012 Summer Olympics in London. The U.S. won, 7-6, and advanced into the quarterfinals.

Was there any other way to go out in the final individual race of his career?

With those long arms whirling through the water, Phelps was next-to-last when he touched the wall at the far end of the pool in the 100-meter butterfly but in a familiar position when he made the touch that counted Friday — his name atop the leaderboard, a smile on his face, another gold medal around his neck.

“I’m just happy that the last one was a win,” Phelps said. “That’s all I really wanted coming into the night.”

Phelps claimed his third gold of the London Games and 17th of his career, adding to an already absurd record total that should be twice as much as anyone else by the time he swims the final race of his career, the 4x100 medley relay Saturday night.

The Americans are huge favorites in a race they have never lost, and it’s unfathomable to think the Phelps era could end with anything less than a performance that puts him atop the podium one last time.

In what might be viewed as a symbolic changing of the guard from America’s retiring swimming star to the next big thing, 17-year-old Missy Franklin set a world record in the 200 backstroke, her third gold in London, just minutes before Phelps took center stage at the Olympic Aquatics Centre. Another American teen, 19-year-old Elizabeth Beisel, claimed the bronze in that race.

“I can’t believe what just happened,” said Franklin, who had dedicated her Olympics to victims of the theater 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.”

Right after Phelps was done, 15-year-old Katie Ledecky — the youngest member of the U.S. team — 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 a race Ledecky dominated from start to finish, falling off record pace only in the last 15 meters.

In other competition:

■ Judo: Wojdan Ali Seraj Abdulrahim Shahrkhani became the first Saudi woman to compete at the Olympics when she lost her judo fight in 82 seconds. And she only made it to the mat after a compromise between Olympic organizers, the international judo federation and Saudi officials cleared the way for her to wear a modified hijab.

■ Track and field: Olympic Stadium was packed for the first time since the opening ceremony, and heptathlete Jessica Ennis gave the delirious crowd exactly what it was hoping to see.

Ennis finished the 100-meter hurdles in 12.54 seconds, the fastest time ever in the heptathlon’s first event and the highlight of a raucous opening session for track and field.

■ Tennis: There were more stirring moments as Wimbledon, where Roger Federer was pushed to the limit in his pursuit of his first Olympic singles medal.

Like so many other times on Centre Court, he delivered.

Federer rallied past Juan Martin del Potro of Argentina 3-6, 7-6 (5), 19-17 to reach the final. At 4 hours, 26 minutes, it was the longest three-set men’s match of the Open era.

Federer faces another tough challenge when he meets Britain’s Andy Murray in Sunday’s gold-medal match. Murray, who advanced with a 7-5, 7-5 victory over Novak Djokovic, lost to Federer in the Wimbledon final last month.

■ Soccer: U.S. soccer star Abby Wambach is battling Achilles tendinitis while dealing with a constant stream of defenders determined to shut her down in the London Olympics. She just keeps scoring anyway.

The 32-year-old striker slid onto a pass in the 27th minute to knock home her fourth goal of the tournament and then celebrated with a cartwheel in the United States’ 2-0 win over New Zealand in the quarterfinals of the Olympic tournament.

■ Gymnastics trampoline: China’s Dong Dong took the gold in men’s competition, putting together a dizzying series of flips and twists.

Singles gold medalist Li Xiaoxia, silver medalist Ding Ning and Guo Yue got the wins for China, which took the top two spots in women’s and men’s singles.

China is under pressure to win all four pingpong golds, which would give it 24 of 28 since 1988 when the sport entered the Olympics.

Japan also swept the United States.

■ Elsewhere: Charlotte Dujardin’s record score riding Valegro helped Britain take a slender lead over Germany after the two-day first round of the dressage competition. Rafalca, co-owned by the wife of U.S. presidential hopeful Mitt Romney and ridden by Jan Ebeling, scored 70.243 percent to place 30th out of 50 riders. ... Oh Jin-hyek of South Korea won the men’s individual archery competition, topping Takaharu Furukawa of Japan in a one-sided final. The bronze went to China’s Dai Xiaoxiang, who beat Rick van der Ven of the Netherlands 10-8 in a shoot-off tiebreaker. ... Svetlana Podobedova won Kazakhstan’s third weightlifting gold medal of the games, beating Russia’s Natalya Zabolotnaya in a women’s 75-kilogram showdown decided on the last lift. Poland’s Adrian Zielinski made the most defending champion Lu Yong’s early exit, winning the men’s 85-kg weight class. ... The badminton gold medal for mixed doubles went to China’s Zhang Nan and Zhao Yunlei. ... South Korea won the men’s team saber.