Tokyo: Caeleb Dressel said it was "really special" to end his Olympics with a storming butterfly leg to help the United States smash their own men's 4x100m medley relay world record on Sunday.
The US team of Ryan Murphy, Michael Andrew, Dressel, and Zach Apple touched in 3min 26.78sec to shatter the global mark of 3:27.28 set at the 2009 world championships.
Britain won silver in 3:27.51 and Italy were third in 3:29.17.
The Americans were trailing at 200m after Andrew's breaststroke leg against Britain's Adam Peaty but when Dressel hit the water that all changed.
He clawed back the lead, leaving Apple to finish the job.
"To end it with this relay is really special, so special," said the 24-year-old, who finished his Tokyo campaign with five gold medals.
Only Americans Michael Phelps, Mark Spitz, and Matt Biondi, and East Germany's Kristin Otto have won five or more swimming golds at one Olympics.
Dressel paid tribute to the British team of Luke Greenbank, Peaty, James Guy, and Duncan Scott for pushing them so hard.
"I think they bring out the best in us, it's so fun racing against these guys," he said.
"There are no guaranteed winners, there really isn't. They have four great guys, we have four great guys. I assumed it was going to be us or them first.
"I knew everyone was going to have to do their job or we're not touching the wall first, and everyone did."