Elia Viviani's Olympic gold medal hopes seemed to have vanished in a tangle of legs and carbon fibre after a crash during the finale of the men's omnium but the Italian recovered to claim an emotional victory.
Clambering back to his feet after the mid-race mayhem that left South Korea's Park Sanghoon in hospital, Viviani kept his wits about him during the rest of the 160-lap points race -- the sixth and final element of the two-day event.
Britain's Mark Cavendish, culpable for the crash, chipped away at Viviani's lead in the standings, as did charging 2012 champion Lasse Norman Hansen of Denmark, but Viviani showed admirable composure in the heat of an attritional battle.
After winning the penultimate sprint, Viviani knew gold was his, barring a last-gasp attack by Cavendish or Hansen. As it turned out, he rode the last 10 laps out in front, leaving Britain's Cavendish to take the silver 13 points adrift and Hansen the bronze a further two back.
He grabbed an Italian tricolore for a lap of honour and after climbing off his bike, Viviani, a road cyclist for Team Sky, burst into tears. He was the first Italian to win an Olympic track cycling gold medal since 1996.
"For sure it was a bad moment in the race. When I saw the Korean guy in front of me go down I thought 'No chance. I'm going down'," the 27-year-old told reporters.
"I got back on the bike. My adrenaline went up so I was really ready.
"I really enjoyed the last 10 laps. It was the race of my life."
He graciously did not blame Cavendish for the crash - saying it was normal even though the Tour de France great speared his bike into Park's coming out of a corner.
"I should look where I'm going," said Cavendish, who had a nervous wait to make sure he had not been penalised before he could savour a long-awaited Olympic medal.
"It was my fault. I hope he's all right. I apologised to Elia after he went down."
Going into the points race, where riders contest a sprint every 10 laps to claim points, Viviani led by 16 from Cavendish.
Hansen then launched an attack and lapped the field, resulting in a 20-point bonus, as did world champion Fernando Gaviria who paid later when cramps ended his medal charge.
As Park was loaded on to a stretcher the race was neutralised, giving Viviani the chance to recover from his fall and Hansen to get a breather.
Cavendish, who has 30 Tour de France stage wins including four this year but suffered Olympic heartache in 2008 and 2012, was the thoroughbred sprinter in the field.
When he won the 12th sprint it seemed he could mount a late charge but his challenge faded.
The Manx Missile was left to rue Sunday's elimination race when an error of judgement cost him points.
"I gave everything I had, I couldn't give any more, so I have to be happy," Cavendish said.
"Elia was strongest across all races, so hats off to the win. I am disappointed it wasn't enough to win."
Britain now has 67 Olympic medals in track cycling, moving ahead of France on the all-time list.