Michael Phelps claimed his second gold medal in one night and the 21st of his career as the United States won the men's 4x200 meters Olympic freestyle relay on Tuesday.
The most successful Olympian of all time swam the final leg to extend his career tally to a total of 25 medals, also including two silver and two bronze.
Earlier he had won gold number 20 with victory in the 200m butterfly.
It was the fourth successive US Olympic victory in the event.
The Americans led throughout, with Conor Dwyer handing over to Townley Haas and Ryan Lochte. There was a huge roar from the Rio crowd when Phelps sprang from the block with a lead of 1.76 seconds over Japan, and 2.88 seconds over Britain.
The Americans touched home in 7 minutes 00.66 seconds.
For Britain, who had qualified first for the final, James Guy overhauled Takeshi Matsuda on the final leg to take the silver in 7:03.13, with Japan clocking 7:03.50.
It was Britain's first medal in this event since they won a bronze in 1984, and made up for Guy's disappointment in failing to pick up a medal in the 200m and 400m freestyle.
But the night belonged to the Americans and Phelps, who after four days of competition in Rio has won three gold medals at his fifth Olympic Games.
Phelps wins 200m butterfly
Earlier, claimed the 20th Olympic gold medal of his career by winning the 200 meters butterfly final in a race that made up for a stinging 2012 defeat to South African Chad Le Clos.
Japan's Masato Sakai took the silver medal and Hungary's Tamas Kenderesi the bronze.
Le Clos, whose run-up to the Games was overshadowed by news that both his parents had cancer, finished fourth.
The 31-year-old is the most medalled athlete of all time.
Ledecky wins women's 200m freestyle for second gold
Katie Ledecky of the United States won the women's Olympic 200 metres freestyle to claim her second individual gold of the Rio de Janeiro Games.
Sarah Sjostrom of Sweden took the silver medal, and Emma McKeon of Australia won bronze.
Ledecky, 19, added to her gold in the 400 freestyle on Sunday and silver in the 4x100 freestyle relay the day before. She reigns supreme in her final individual event, the 800 freestyle, which she won at London in 2012.
She now looks overwhelmingly likely to achieve her goal of three individual golds in the 200, 400 and 800 - a feat not achieved at a single Games since American Debbie Meyer accomplished it in Mexico City in 1968.
"That was a really tough race and it hurt really badly," Ledecky said. "Pretty sure that's the closest I've come to throwing up in the middle of a race. I'm just so glad I got my hand on the wall first."
McKeon, a gold medalist in the 4x100 freestyle relay, led at half-way, with Ledecky second and Sjostrom third.
At the final turn, Ledecky led from Sjostrom, and the two were matched stroke for stroke as they entered the last 25 meters, but the American pulled ahead to touch the wall in one minute, 53.73 seconds.
Sjostrom, who won the 100 butterfly on Sunday, clocked 1:54.08 and McKeon 1:54.92.
Hosszu takes third solo gold in 200m medley
Hungary's Katinka Hosszu won her third Olympic gold medal in four days with victory in the women's 200m individual medley.
The 27-year-old, who set an Olympic record of two minutes, 6.58 seconds, had already won the 400 individual medley on Saturday and 100 backstroke on Monday.
Britain's Siobhan-Marie O'Connor took the silver medal, with Maya DiRado of the United States winning a bronze to add to her 400 IM silver.
Hosszu, the 'Iron Lady' who withdrew from the 200m butterfly earlier on Tuesday to prepare for the evening race, is entered in one more individual event, the 200 backstroke.
If she wins that she would equal the women's record of four solo swimming golds at a single Games set by East Germany's Kristin Otto in Seoul in 1988.
Hosszu led from the start, inside world record pace for the first 100 meters, with 2015 world championships bronze medalist O'Connor second all the way for the first Olympic medal of her career.
O'Connor, 20, was Britain's youngest swimmer at her home Games in 2012 and became the country's third individual medalist of the Rio swimming meet.
Her time of 2:06.88 was a British record. DiRado finished in 2:08.79.