Phelps and fellow teammates Matt Grevers, Brendan Hansen and Nathan Adrian took the gold in the 4x100 medley relay with the time of 3:29.35. Japan took silver and Australia took bronze.
Phelps had said London would be his final swim meet. He claimed four gold medals and two silvers at these games. He is retiring with a myriad of Olympic records, including twice as many golds as anyone else (18) and 22 medals overall, four more than anyone else in any sport.
In his final individual race on Friday, Phelps hit the wall. He rallied to win the 100-meter butterfly for his third gold medal in London and 17th Olympic gold overall.
Meantime, Oscar Pistorius of South Africa became the first amputee to compete in track at the Olympics.
Pistorius finished second in his 400-meter heat, circling the oval in 45.44 seconds, to advance to the next round, the semifinals. He is a double-amputee who runs on carbon-fiber blades, which earned him the nickname "Blade Runner."
Pistorius has four Paralympic gold medals, but this latest trip around the track is about something different. He waged a long fight to run in the Olympics against able-bodied opponents.
After dozens of hearings in front of hundreds of men and women charged with the task of deciding whether the blades gave Pistorius an unfair advantage, Pistorius got his country's Olympic committee to accept his qualifying times and enter him into the games.
The 25-year-old runner was born without fibulas and his legs were amputated below the knee before he was a year old.
In the women's 100 meter sprint, Jamaica's Fraser-Pryce edged American Carmelita Jeter by .03 seconds for the gold.
Day eight of these Olympic games is called Super Saturday, with 25 gold medals are up for grabs. It's the busiest day of the Olympics so far. U.S. athletes began snapping up the gold - beginning with tennis.
Serena Williams took Olympic gold after dominating her match against Maria Sharapova, 6-0, 6-1. Each set lasted about 30 minutes, with Williams sailing through point after point. With her latest victory, Williams has become just the second woman ever to earn a Golden slam. Steffi Graf is the only other women's tennis player to sweep all four major titles.
In the men's doubles gold medal match, Bryan brothers, Mike and Bob, beat France's Jo-Wilfried Tsonga and Michael Llodra.
In women's swimming, Americans Missy Franklin, Rebecca Soni, Dana Vollmer and Allison Schmitt took the gold in the 4x100 medley relay. The group also set a world record with their time of 3:52:05, beating the previous time of 3:52:19 set by China in the 2009 Olympic games in Rome.
It was a big day in the pool for America. Franklin, 17, also won her third gold medal in London. She set a new world record in the 200-meter backstroke. Katie Ledecky, who at 15 is the youngest U.S. swimmer in London, nearly broke the world record to win gold in the 800 freestyle.
Also, Riverside's Tyler Clary rallied on the final lap to pull off the upset in the 200 backstroke. Clary passed defending champion Ryan Lochte to win the gold medal and set a new record.
In basketball, the U.S. beat Lithuania by a slim score of 99-94. This came two days after the U.S. shattered a record with an 83-point win over Nigeria.
American Jamie Lynn Gray won the gold medal in women's 50-meter three-position rifle shooting, setting two Olympic records along the way. Gray clinched gold on her final shot with a 10.8 - just 0.1 off a perfect score.
Serbia beat the U.S. 11-6 in the men's water polo tournament.
The Associated Press contributed to this report.