(CNN) Michael Phelps produced a vintage performance to claim an astonishing 19th Olympic gold medal of his career on Sunday.

The 31-year-old, who quit the sport after the 2012 Games , was back with a bang in Rio as Team USA eased to victory in the 4x100 meters freestyle relay.

Phelps, who produced a stunning second leg, has now won 23 medals in total, extending his record as the most decorated Olympian of all time.

With son Boomer in attendance, Phelps did his kid proud, along with teammates Caleb Dressel, Ryan Held and Nathan Adrian.

It was the second gold of the night for the U.S. after Katie Ledecky produced an astonishing performance to win gold in the 400m freestyle.

The 19-year-old smashed her own world record to win in a time of 3:56.46 -- nearly five seconds ahead of her closest rival.

Ledecky's previous best in the 400m was in August 2014, when she came home in 3:58.37 at the Pan Pacific Championships.

But she tore that time to pieces to finish ahead of Britain's Jazz Carlin and U.S. teammate Leah Smith.

A day after anchoring the U.S 4x100m relay team to silver, Ledecky showed just why she's being touted as the best female swimmer on the planet.

Ledecky stunned the world at London 2012 by recording the second fastest 800m time in history at the age of just 15.

She has now set 12 world records in the past four years and could yet add the 200m and 800m titles before she's done.

Breaststroke sensation Adam Peaty earned Great Britain its first gold medal of the Games with a typically stylish performance.

The 21-year-old smashed his own record to add the Olympic title to his world and European crowns.

"It's so surreal to get Team GB's first gold," Peaty, the first British man to win gold in the pool since 1988, told BBC Sport.

"I came out tonight and took the first 50 easy and came back with everything I have got.

"I did it for my country and that means so much for me."

In the first race of the evening, Sarah Sjostrom broke her own world record to become the first Swedish woman to win Olympic gold in the pool.

The three-time world champion won the women's 100m butterfly after racing home in 55.48 seconds to finish ahead of 16-year-old Canadian Penny Oleksiak and U.S. defending Olympic champion Dana Vollmer.