Tadej Pogacar's historic bid to become the first cyclist to win Olympic road race gold immediately after winning the Tour de France fell just short on Saturday after Ecuador's Richard Carapaz triumphed with a perfectly-timed final descent.
It was only Ecuador's second-ever gold, and third medal of any colour, at the Olympics after Jefferson Perez won the 50km race walk in the 1996 Atlanta Games.
As expected, Slovenia's Pogacar launched his assault for victory on the fearsome Mikuni Pass, a brutal climb around 35 km from the end of a 234km race ridden in hot and humid conditions.
But UAE Team Emirates' Tour de France champion had not counted on the resolve of Carapaz, who, along with Belgium's eventual silver medallist, Wout van Aert, hunted down Pogacar and with around 20km remaining the Ecuadorean seized his chance to take control.
Escaping with American Brandon McNulty - Pogacar's teammate at UAE Team Emirates - on the short Kagosaka climb before a long descent back to the racing circuit finale, the duo put almost a minute on a flagging pack.
It looked like a straight battle between Carapaz and McNulty as they stole almost two minutes on the chasers, but the acceleration took its toll on McNulty and as the pack began to reel them in, Carapaz decided his only chance for gold was to strike out alone for the finish in the final 5km.
The South American, who placed third at the Tour de France, found another gear and began to extend his lead with every turn of the pedals in front of hundreds of cheering spectators lining the circuit.
With the gold assured he could even enjoy the final turns as the battle for silver raged behind him - crossing the line one minute and seven seconds clear.
Pogacar, whose Tour de France triumph came just last week, was edged out by Van Aert in a sprint finish decided by the width of a wheel rim.
"It's an incredible moment for me. You always have to believe. I have worked so hard to be here and it's a huge moment," Carapaz, 28, said. "I can only say thank you to (the Ecuadorean people) for the support and, honestly, for giving us such a big push."
Carapaz is also the first South American to win an Olympic road race dominated in the past by Europeans and expected to have been on Saturday, with Pogacar the favourite.
A breakaway group moved 20 minutes clear at one point but the real contenders were just conserving their energy for the climbs that came thick and fast late on.
The forest-flanked 14km Fuji Sanroku climb on Japan's sacred mountain did not produce the expected attacks but took its toll with 2016 gold medallist Greg Van Avermaet emptying the tank in support of Van Aert, Belgium's new superstar.
But it all kicked off later on the Mikuni Pass featuring gradients of up to 20 per cent as sweat-drenched riders began to disappear off the back.
Pogacar initially looked as though he was poised to strike for home, but it was Carapaz's day.
Thankfully the race was spared the big crashes that marred the road races at the Rio Games five years ago, though Britain's Geraint Thomas, one of the medal favourites, hit the tarmac hard in an early incident and eventually pulled out with 50km left.