Singapore’s Joseph Schooling won butterfly gold in 50.39 seconds, eight years after being a starry-eyed schoolboy and posing for a photo with Phelps.

The 31-year-old American, who plans to retire after his fifth Games (and 22 gold medals) finished in 51.14secs – joint second with TWO other swimmers, Laszlo Cseh of Hungary and Chad le Clos of South Africa.

Joseph Schooling with his gold (Michael Sohn/AP)

Schooling first met Phelps at a USA training camp ahead of the Beijing Olympics, where Phelps won eight gold medals.He posed for a photo with the then 13-year-old.

#SIN's Joseph Schooling idolized Michael Phelps as a boy. Last night he beat him the 100m butterfly. #Swimming pic.twitter.com/FCIYAkGj60

— Rio 2016 (@Rio2016_en) August 13, 2016

It was Singapore’s very first Olympic gold medal, so Singaporeans were feeling very proud.

i love singapore so much it is so small but so mighty and joseph schooling is wonderful and i am very proud to have grown up there

— ASYA (@communistbabe) August 13, 2016

Feeling proud in London because Joseph Schooling clinched the gold from his former idol Michael Phelps! It's also Singapore's first gold.

— Wong Yi Wei (@SinicCynic) August 13, 2016

Shoutouts to Joseph Schooling!! Proud to have a true blue son of Singapore bring us our first ever Olympic gold medal & in record time!

Phelps seemed pretty happy with a silver medal though.

A silver isn’t so bad (AP)