Aaron Peirsol, Brendan Hansen, Phelps and Jason Lezak won in a world-record of 3 minutes, 29.34 seconds, lowering the old mark of 3:30.68 set four years ago in Athens.
The U.S. swept the men's relays in Beijing, with Phelps leading off in the 400 and 800 free relays. Lezak anchored the 400 free to a narrow victory over France to preserve Phelps' historic bid.
Australia took the silver in 3:30.04.
Japan earned the bronze in 3:31.18.