Phelps now has 19 career medals spanning three Olympics. He moved one medal ahead of the record held by Soviet gymnast Larisa Latynina, who earned her haul in 1956, 1960 and 1964 Games, The Associated Press reported.
The United States team of Ryan Lochte, Conor Dwyer, Ricky Berens and Phelps on the anchor leg won in 6 minutes, 59.70 seconds. France took the silver in 7:02.77, while China was third in 7:06.30, according to the NBC Olympics website.
Phelps now has 15 golds, two silvers and two bronzes, USA Today reported.
In an earlier stunner, Phelps settled for a silver medal in his signature event — the 200m butterfly — when he made the mistake of gliding to the finish and was out-touched at the wall by South Africa's Chad le Clos, according to the AP.
Le Clos won in a time of 1 minute, 52.96 seconds. Phelps finished in 1:53.01, while Japan's Takeshi Matsuda took the bronze in 1:53.21.
Phelps flipped away his cap in disgust after seeing the results, the AP reported.
"I'm shocked," ESPN's Wayne Drehs wrote on Twitter. "That is the first time Phelps has lost that race at a major international competition since 2000."