Britain's Chris Froome was forced to run without a bike following a crash with a motorbike on one of the most iconic climbs of the Tour de France.
Froome crashed with Richie Porte and Bauke Mollema just over one kilometre from the finish on Mont Ventoux.
The defending champion was overtaken by rivals Adam Yates and Nairo Quintana in the melee but race organisers ruled Froome should retain the overall lead.
Thomas de Gendt won stage 12, which had been shortened because of high winds.
Speaking to French TV, Froome, the 2013 and 2015 champion said: "I was with Richie Porte and Bauke Mollema and all three of us went into the back of the motorbike. I got hit from behind by another motorbike that broke my bicycle.
"I told myself, 'I don't have a bike and my car is five minutes behind with another bike - it's too far away, I'm going to run a bit'."
The Team Sky rider finished one minute and 40 seconds behind Trek-Segafredo's Mollema, who had immediately managed to remount his bike, and 44 seconds behind BMC's Porte.
But Porte and Froome were given the same time as Mollema, five minutes five seconds behind Lotto Soudal rider De Gendt.
Froome said: "I'm happy with the jury's decision. I think it's right. Thanks to them and thanks to the Tour de France organisation."
- Rocky, Bolt and running the bulls - Froome inspires online hilarity
- 'I've never seen anything this' - how BBC Radio 5 live reacted to Froome on foot
- Bespoke podcast: Listen to a review of stage 12
- Relive chaotic finish as Froome runs up Mont Ventoux
How did it happen?
As Froome climbed towards the finish line at Chalet Reynard, Porte rode into the back of a motorbike, which seemed to stop suddenly because of crowds encroaching on to the road.
Froome and Bauke Mollema crashed into the Australian and all three fell off their bikes.
With his bike damaged, Froome set off on foot as he waited for a replacement.
According to the UCI, cycling's governing body, a cyclist can cross the line on foot but only if they have their bike with them.
He attempted to use a neutral service bike before switching to a third bike from the Team Sky car about 200 metres later, eventually crossing the line shaking his head.
Froome, who held a 28-second advantage over Yates overnight, extended his lead to 47 seconds, with Quintana - regarded as Froome's biggest rival before the race - a further seven seconds adrift.
Porte, 31, said: "The crowd were all over the road and it was such a mess. It was just crazy.
Dutchman Mollema, 29, tweeted a picture of the crash and said: "This may NOT happen in the biggest race of the world!! There has been too many accidents with motos last year!"
Analysis - What will happen now?
BBC Radio 5 live cycling commentator Rob Hatch
"It was a dangerous situation and one that will concern riders.
"The organisation has to take some blame, and there's a balance to be found between safety and preserving supporter passion."
'A scandal' - cycling reacts
It remains unclear whether the motorbike that Porte collided with stopped because of spectators stepping into its path.
But over-zealous fans have caused problems already on this year's Tour, with Froome fined 200 Swiss Francs (£153) for lashing out at an encroaching fan on stage eight.
There have been regular calls from riders and organisers for spectators to respect the space of the cyclists.
The end of the stage up the legendary Mont Ventoux was cut short by 6km on Wednesday because of strong winds, reducing the space for spectators to line the route to the finishing line.
Among riders there was anger aimed towards some of those who had come to watch the race as well as Tour officials.
Veteran rider Fabian Cancellara tweeted: "What a scandal today for Le Tour, No safety and too much chaos on Mont Ventoux.
"This is definitely not what cycling needs. Not enough barriers for safety."
Trek's Gregory Rast said: "All day we work, fight and suffer and they are too lazy to put barriers on the last km?? I feel sorry for the GC (general classification) guys crashed there!"
Cannondale's Lawson Craddock questioned why four motorbikes were needed ahead of Porte, adding: "Let us race!!"
BMC Racing's Brent Bookwalter tweeted: "There is enough bike-mayhem during any TDF stage, without having to worry about crashes by fans and race motos. Up your game Le Tour!"
What else happened?
Amid all the chaos, it was easy to overlook De Gendt's tremendous win in the 178km stage from Montpellier.
The Belgian, runner-up on stage five, was part of an early 13-man breakaway and had initially dropped off the front, but he fought back and finished narrowly ahead of compatriot Serge Pauwels in the final stretch to claim the king of the mountains jersey.
Orica-BikeExchange rider Yates, who is having a superb Tour, briefly led the general classification, before Froome's time was amended.
Yates, the 23-year-old from Bury who is in Great Britain's road race team for the Olympics in Rio in August, remains Froome's closest rival.
Quintana, who is a renowned for his climbing ability, was expected attack on stage 12 to regain time on Froome.
But the Colombian, twice runner-up to Froome at the Tour, looked out of sorts as his rival pulled away in the final six kilometres.
Froome runs for home
Stage 12 result
1. Thomas de Gendt (Bel/Lotto Soudal) 4hrs 31mins 51secs
2. Serge Pauwels (Bel/Dimension Data) +2secs
3. Daniel Navarro (Spa/Cofidis) 14secs
4. Stef Clement (Ned/IAM Cycling) +40secs
5. Sylvain Chavanel (Fra/Direct Energie) same time
6. Bert-Jan Lindeman (Ned/LottoNL) +2mins 52secs
7. Daniel Teklehaimanot (Eri/Dimension Data) +3mins 13secs
8. Sep Vanmarcke (Bel/LottoNL) +3mins 26secs
9. Chris Sorensen (Den/Fortuneo) +4mins 23secs
10. Bauke Mollema (Ned/Trek) +5mins 5secs
General classification after stage 12
1. Chris Froome (GB/Team Sky) 57hrs 11mins 33secs
2. Adam Yates (GB/Orica-BikeExchange) +47secs
3. Nairo Quintana (Col/Movistar) +54secs
4. Bauke Mollema (Ned/Trek) +56secs
5. Romain Bardet (Fra/AG2R) +1mins 15secs
6. Alejandro Valverde (Spa/Movistar) +1mins 32secs
7. Tejay van Garderen (USA/BMC Racing) same time
8. Fabio Aru (Ita/Astana) +1min 54secs
9. Daniel Martin (Ire/Etixx-Quick-Step) +1min 56secs
10. Joaquim Rodriguez (Spa/Katusha) +2mins 11secs