21-year-old Singapore swimmer Joseph Isaac Schooling's rise to fame reached new heights when he nabbed his country's first Olympic gold ever, winning the 100m butterfly with an Olympic record time of 50.39s.
He swam side-by-side with his idol Phelps, who came in equal second with a time of 51.14s.
"It's like a dream come true. I'm really honored and privileged to have swam alongside these great names, people that have changed the face of our sport," said Schooling to Channel NewsAsia.
Singapore's prime minister Lee Hsien Loong has congratulated the swimmer on his Facebook page.
"It is an incredible feat, to compete among the world's best, stay focused, and emerge victorious. Congrats once again to Joseph, you made us very proud today," said Lee.
"To all of Team Singapore - thank you for showing us what it means to work hard and never give up on our dreams."
Singapore praises 'world-class' winner
Schooling was the first Singaporean athlete to be granted deferment by the government from his compulsory two-year conscription in October 2013.
Ms Lee Bee Wah, a member of Parliament, said on Facebook that she was glad she had asked Singapore's Defense ministry to let Schooling defer his National Service obligations to let him focus on training.
"Both you and Quah Zheng Wen (another Singapore swimmer at Rio) have used the deferment wisely and done us proud," said Lee.
The hashtag #josephschooling trended on Twitter just after Schooling's win, with many congratulating him on his success.
Local radio DJ Tabitha Nauser called him "world-class", while singer Benjamin Kheng said his win was "how you unite a nation", ending his tweet with #MadProud.
Schooling had already created history by being the first Singaporean swimmer to make it to an Olympic final, with a time of 50.83s in the 100m butterfly semi-finals.
Phelps encouraged Schooling to win
Schooling has long cited Phelps as his idol -- in 2008, Schooling's parents helped to host a meet with the US swimming champion, where the Singaporean met Phelps for the first time.
The grandson of high-jumper Lloyd Valberg, Singapore's first Olympian at the 1948 Games, Schooling enrolled into the Bolles School in Florida just a year after meeting Phelps.
But when making his Olympic debut in 2012, Schooling's swim cap and goggles were rejected just before the 200m butterfly heats for not meeting Olympic regulations. He finished 26th overall, with a time of 1:59.18s.
After the race, Schooling said Phelps had noticed the dejected Singaporean walking behind him.
"I told him what happened and he hugged me and said, 'You're only so young, you still have a long way to go. It's a learning experience so keep your head high and just keep moving on.'"
In an ESPN documentary in 2012, Schooling said that he was keen to make his own mark, away from his idol.
"I just want to make my own career for myself. Michael Phelps may be my idol, but I just want to make my own career," Schooling said.