Xander Graham raced alongside riders on the Tour of Britain near Edinburgh before being handed a water bottle from Dutch cyclist Pascal Eenkhoorn.
The impromptu meeting was broadcast live to TV audiences around the world.
A video posted on the race's social media accounts had more than a million views within 24 hours.
Aspiring cyclist Xander, from Bonnyrigg in Midlothian, had gone to watch riders on the seventh stage of the race near his home. He had been cycling himself earlier in the day and had his bike to hand.
In a spur of the moment decision, he began cycling along the pavement as a breakaway group quickly sped past them.
He told the BBC: "We already knew they were going to be there because we had seen the route online.
"They were coming round the corner and people were clapping and that's when I decided to start riding up beside them.
"It was about one minute and I was just riding as fast as I could - about 25km an hour I think."
As a reward for his efforts, Eenkhorn, of Netherlands' Team Jumbo-Visma - part of a five-rider breakaway - could be seen passing Xander his water bottle, or bidon.
Catching a bidon thrown by a rider is traditional in cycling, but was banned for a few months earlier this year by the sport's governing body in order to crack down on littering and as a safety precaution.
The water bottle is something Xander plans to treasure.
"I was just in shock," he said. "I was so happy and amazed. I'm getting a shelf for it to put up in my room."
Even prior to his moment of fame, Xander had racked up a number of accolades with Scottish Cycling, including winning the 2019 and 2021 road bike series.
His dream is to go pro - and he was delighted when one of the Tour of Britain's sponsors, Eisberg, offered him VIP tickets to watch the final stage of the race in Aberdeen.
He said: "I met Mark Cavendish, I met Wout van Aert - lots of people. They actually came over to me and were speaking to me, they knew who I was. They were all saying really nice things to me.
"Eenkhorn was really nice, he took me on a tour of the bus and I went on the stage with them.
"He's definitely one of my heroes now."