The United States won the men's 4x100 metres medley relay on Saturday after Ryan Murphy had given them a world record start that propelled Michael Phelps to a 23rd gold medal in his final Olympic race.
Britain took the silver medal and Australia bronze.
Phelps, who swam the third butterfly leg, ends the most successful Olympic career of all time with 23 golds, three silver and two bronze.
Murphy broke the world record for the 100 backstroke in the leadoff, clocking 51.85 seconds to eclipse the 51.94 that compatriot Aaron Peirsol swam in 2009.
Britain's Olympic champion Adam Peaty then swam the breaststroke leg in a scorching 56.59 seconds to move his team up from sixth to first place, with Cody Miller touching second for the US at half-way.
A huge roar went up when Phelps hit the water for the butterfly and then caught and overhauled Britain's James Guy to hand a 0.41 second cushion to Nathan Adrian.
After the race, Phelps raised his alarms aloft to acknowledge the cheers from the crowd, while fiancee Nicole wiped tears from her eyes as she cradled their baby, Boomer, in the crowd.
The Americans finished in three minutes, 27.95 seconds, an Olympic record, to win by 1.29 seconds.
The US have won the event at every Olympics since 1960, except the 1980 Games in Moscow which they boycotted.