Lithuania's Ramunas Navardauskas was the surprise winner of a rainy stage 19 of the Tour de France in Bergerac.
The Garmin-Sharp rider broke clear with around 12km remaining and crossed the line seven seconds ahead of John Degenkolb and Alexander Kristoff.
A bunch sprint had been expected but a crash on the wet roads in the final 3km derailed the sprinters' teams.
Race leader Vincenzo Nibali avoided the crash to retain his seven minutes, 10 seconds advantage over Thibaut Pinot.
|Magnus Backstedt - Former Tour de France stage winner|
|"It was a brave attack by Navardauskas. He was slightly lucky in that there was a big crash with a couple of kilometres to go and that took the sting out of the chase with teams looking round to see who they had left. Cannondale had nobody with Peter Sagan going down but you have to take advantage of the luck. Garmin really needed this. It was interesting tactics. Going out there and chasing down your team-mate is not something you normally do."|
|Listen to the 5 live podcast|
Even if Italian Nibali had been delayed he would have kept his advantage because the accident happened in the final 3km and Tour rules state that on sprint finishes you will be credited with the time of the group you were riding with.
However, it was a stark reminder to Nibali that, despite holding what appears to be an unassailable lead in the race for the yellow jersey, he still has to finish in Paris on Sunday.
The Astana rider had to take evasive action to avoid the crash, which happened on a right-hand corner, and took out, among several others, Peter Sagan, the man leading the green points jersey competition.
Cannondale rider Sagan, who needs to reach Paris unscathed to win that classification for the third year in succession, was soon on his feet but had to wait a couple of minutes for a replacement bike to enable him to finish the stage.
It was a frenetic ending to what had been a rather predictable and sedate 208.5km stage from Maubourguet.
The rain remained a constant throughout the race across the Dordogne region and the day's early five-man break were kept on a short two-minute leash by the peloton.
Tom-Jelte Slagter rode clear of his fellow escapees with 32km of the race remaining and managed to hold off the chasing bunch until he reached the top of the only categorised climb, the category four Cote de Monbazillac.
The 1.3km ascent was too much for sprinter Marcel Kittel, winner of three of the Tour's first four stages, as he dropped out of contention.
Navardauskas was the first to catch Slagter, an unusual move given they are team-mates, and he raced clear on the descent, building a lead of 25 seconds.
It looked like the chasing peloton would catch him on the run-in to Bergerac but the crash ended their hopes.
|What to expect on stage 20|
|"Because this is the penultimate stage and we don't have to save energy for a sprint finish in Sunday's finale on the Champs Elysees in Paris, it will be down to each individual Team Sky rider whether to go full gas. If you do have a sprinter in your team and eyes on a last-stage victory, you may go easy to save your legs."|
|Read Geraint Thomas's stage-by-stage guide|
Britain's Garmin-Sharp rider David Millar, who was left out of the race, tweeted: "Amazing. Ramunus aka Honey Badger was my replacement. Job well done. Legend."
On hearing about the tweet, Navardauskas told BBC Sport: "It was disappointing for David to miss out with it being his last Tour de France but I got a nice email from him saying he was glad I was in his place.
"He asked me to win something for him and I managed it. It was also for my team-mates who were shoulder to shoulder with me. They covered me from the wind and put me in a good position on the climb.
"Our plan was for Tom and I to go hard on the climb but Tom was already in the break so it was left to me to make the move and he helped me before dropping back."
Saturday's penultimate stage is a 54km time trial from Bergerac to Perigueux.
Stage 19 result
1. Ramunas Navardauskas (Lit/Garmin-Sharp) 4hrs 43mins 41secs
2. John Degenkolb (Ger/Giant-Shimano) +7secs
3. Alexander Kristoff (Nor/Katusha)
4. Mark Renshaw (Aus/Omega Pharma - Quick-Step)
5. Daniele Bennati (Ita/Tinkoff - Saxo)
General classification after stage 19
1. Vincenzo Nibali (Ita/Astana) 85hrs 29mins 26secs
2. Thibaut Pinot (Fra/FDJ.fr) +7mins 10secs
3. Jean-Christophe Peraud (Fra/AG2R) +7mins 23secs
4. Alejandro Valverde (Spa/Movistar) +7mins 25secs
5. Romain Bardet (Fra/AG2R) +9mins 27secs