Michael Phelps claimed a 19th Olympic title as three world records were broken ©Getty Images

Sweden's Sarah Sjöström, Britain's Adam Peaty and United States' Katie Ledecky each broke world records in the pool before Michael Phelps brought the curtain down on a thrilling night of swimming action by helping his team to a 4x100 metres freestyle relay gold medal.

It was a 19th gold medal for the 31-year-old, already the most decorated Olympian of all-time, and he showed his trademark fighting spirit with a second leg of 47.12sec to propel his team into the lead.

They never looked like losing from there, as Ryan Held and than Nathan Adrian moved further head to take victory in 3min 09.92sec.

Caeleb Dressel had put them in second place after leg one before they avenged their defeat to France four years ago in London.

France had to settle for second place on this occasion, in 3:10.53, while Australia took bronze in 3:11.37. 

For Phelps, it marked a triumphant return after his brief retirement from the sport.

Katie Ledecky broke her own world record to win the 400m freestyle ©Getty Images
Katie Ledecky broke her own world record to win the 400m freestyle ©Getty Images

Ledecky arguably outdid her compatriot, however, by shattering the world record to win the 400m freestyle, the first American gold medal in the pool at Rio 2016. 

Her biggest opponent was the clock as she won in 3:56.46 to take almost two seconds off her previous mark before screaming and punching her fist in celebration.

"Three fifty six was the goal I set after Barcelona 2013 [World Championships]," she said.

"So it feels really good. 

"I'm pumped, I was so close to breaking it [this morning].

"I felt good throughout - the swim was almost identical to this morning, but with a bit more pop on the last lap."

Britain's Jazz Carlin claimed the silver medal in 4:01.23 as another American, Leah Smith, touched third in 4:01.92.

Adam Peaty broke the 100m breaststroke world record for the second time in two days to win Britain's first gold medal of Rio 2016 and maintain a unique record stretching back 120 years ©Getty Images
Adam Peaty broke the 100m breaststroke world record for the second time in two days to win Britain's first gold medal of Rio 2016 and maintain a unique record stretching back 120 years ©Getty Images

Peaty, meanwhile, smashed the world record he had set in the 100m breaststroke in yesterday's heats.

He won in 57.13sec, compared with 57.55, to beat South Africa's defending champion Cameron van der Burgh, who swam

Cody Miller of the US took the bronze medal in 58.87.

"It's surreal," Peaty said.

"After my race I needed to slap something and there was just the water right there. 

"It was crazy - it's amazing and I probably won't be able to sleep tonight."

It continued Britain's unique record of winning a gold medal at every edition of the Summer Olympics since Athens in 1896.

Sweden's Sarah Sjöström had every reason to be happy after winning the 100m butterfly in a world record, making up for the disappointment of missing a medal at London 2012 ©Getty Images
Sweden's Sarah Sjöström had every reason to be happy after winning the 100m butterfly in a world record, making up for the disappointment of missing a medal at London 2012 ©Getty Images

Sjöström also broke her own world record to take the 100m butterfly.

Her time of 55.48 took 0.16 seconds off her time at last year's World Championships and made amends for her fourth place finish at London 2012.

Sixteen-year-old Penny Oleksiak of Canada - only three months old when Michael Phelps swam at his first Olympics at Sydney 2000- took the silver medal in 56.46.

Defending Olympic champion Dana Vollmer took another US bronze, returning from childbirth last year, to clock 56.63.