The 31-year-old, raising a roar from the crowd on his first competitive appearance at his fifth Games after sitting out the heats, now has an unprecedented 23 medals with two silvers and two bronzes filling out his tally.
London 2012 champions France took the silver medal, their third successive podium in the 4×100,
and Australia the bronze.
With baby son Boomer in the audience for the first time at an Olympics, Phelps swam the second leg of a race that has brought him four of his medals over the years including gold in Beijing in 2008.
If anyone is used to the atmosphere and the pressure, it is Phelps but even he ? 16 years on from his Olympic debut ? felt the sense of occasion.
“On the block I thought my heart was going to explode, I was so hyped, so excited,” he said. “It was so loud, I don’t think I’ve ever heard something like that.”
The most decorated Olympian of all time has now won gold at four separate Games, the first swimmer to do so.
The U.S. team set a world record of three minutes, 8.24 seconds in the Beijing final, a race in the bodysuit-era that still stands and is likely to endure for some time to come.
On Sunday they came closer than anyone has ever done wearing textile suits, when the quartet of Caeleb Dressel, Phelps, Ryan Held and 100 freestyle world champion Nathan Adrian clocked 3:09.92.
Dressel completed his opening leg just two hundredths behind the French in 48.10 and Phelps made the difference, taking the lead off a strong turn and clocking out at 47.12 with Held putting in a 47.73 and Adrian fastest of all in 46.97.
Michael Phelps of USA reacts after his team won the gold.
As he has done so many times in the past, Phelps kissed the medal on the podium and waved at the crowd with tears in his eyes and a supportive arm for an emotional Held and Dressel who were collecting the first Olympic medals of their careers.
“I told them, it’s OK to cry. It’s good to see some emotion as one of the old dudes,” said Phelps.
The 35-year-old Anthony Ervin, who won 4×100 relay silver in 2000, swum in the heats to collect another medal 16 years after his first.
Jimmy Feigen and Blake Pieroni also swam in the heats.
The victory maintained a run of U.S. success in the event, with the Americans medaling in every 4×100 freestyle relay raced at the Games since it was first included in 1964.
It also meant the United States ended the second day of the meet with two golds, level with Australia who won two on Saturday.
“I think we did our best on the night and are really happy with the bronze medal,” said Australian James Magnussen who swam his team’s third leg and paid tribute to Phelps.
“Michael is definitely an inspiration to many of us,” he told reporters. “To stay on top of the world for that many Olympics is something that most of us couldn’t even dream of.
“It gives us guys who are sort of in the middle period of our careers a lot of inspiration to think we can keep going for another Olympics.
“It’s always great to see a fairy tale like that unfold in a race you are part of.