Matej Mohoric won stage 19 of the Tour de France in a thrilling photo finish ahead of Kasper Asgreen in Poligny.
The pair sprinted for the line at the end of a frantic day of racing, with the Slovenian denying Asgreen back-to-back stage wins by the width of a rim.
They had to wait to discover who had won, and an emotional Mohoric was in tears after being told it was him.
Denmark’s Jonas Vingegaard retains his comfortable lead over Slovenia’s Tadej Pogacar with two stages remaining.
Britain’s Adam Yates remains third, with Saturday seeing the Tour return to the mountains before Sunday’s ceremonial procession into Paris.
Stage 20 suits the pure climbers and will decide who joins Vingegaard and Pogacar on the podium as well as settle the order of the top 10 in the General Classification.
This was the final chance for sprinters to take the glory before they fight it out on the Champs Elysees, and also a last opportunity for many other riders and teams to try to grab a stage success through a breakaway.
It led to a fast and furious fight over a lumpy 172.8km route that started in Moirans en Montagne, with escape attempts starting as soon as the stage got under way.
A 36-man break established itself with 65km to go, but splintered into several groups on the biggest climb of the day, the category three Cote d’Ivory.
That was where Asgreen, who clinched an epic breakaway win on Thursday, pushed clear again along with Mohoric and Australia’s Ben O’Connor.
The next chase group had them in their sights on the straight road to the finish with 6km to go, but were wary of setting up sprinter Jasper Philipsen for his fifth stage victory of this year’s Tour, and allowed the gap to grow.
That left the front three to fight out the win and, after O’Connor failed with an early attack, it was Mohoric who followed Asgreen before managing to throw his bike over the line first in a desperate lunge for victory.
Afterwards he paid tribute to his late Bahrain-Victorious team-mate Gino Mader, who died aged 26 in a crash at last month’s Tour de Suisse.
“It means a lot because it’s hard and cruel to be a professional cyclist. You suffer a lot in your preparations, you sacrifice your life, your family and you give everything you can to get here ready,” Mohoric said.
“When Kasper went I knew it was the decisive attack, he was so incredibly strong to win the stage yesterday but he has the will and determination to do it again today.
“I knew I had to do everything perfect, I tried my best for Gino and for the team and in the end you almost feel like you betray [your rivals] because you beat them to the line but it’s just the way professional sport is and everyone wants to win.
“If I want to win I have to follow the wheel of Kasper and then try to beat him in the last 50 metres. I just feel so many things right now.”
Stage 19 results
1. Matej Mohoric (Slo/Bahrain Victorious) 3hrs 31min 2secs
2. Kasper Asgreen (Den/Soudal-Quick-Step) same time
3. Ben O’Connor (Aus/AG2R-Citroen) +4secs
4. Jasper Philipsen (Bel/Alpecin-Deceuninck) +39secs
5. Mads Pedersen (Den/Lidl-Trek) same time
6. Christophe Laporte (Fra/Jumbo-Visma) same time
7. Luka Mezgec (Slo/Jayco-AlUla) same time
8. Alberto Bettiol (Ita/EF Education-EasyPost) same time
9. Matteo Trentin (Ita/UAE Team Emirates) same time
10. Tom Pidcock (GB/INEOS Grenadiers) same time
General classification after stage 19
1. Jonas Vingegaard (Den/Jumbo-Visma) 75hrs 49mins 24secs
2. Tadej Pogacar (Slo/UAE Team Emirates) +7min 35secs
3. Adam Yates (GB/UAE Team Emirates) +10mins 45secs
4. Carlos Rodriguez Cano (Spa/Ineos Grenadiers) +12mins 1sec
5. Simon Yates (GB/Team Jayco-AlUla) +12mins 19secs
6. Pello Bilbao (Spa/Bahrain Victorious) +12mins 50secs
7. Jai Hindley (Aus/Bora-Hansgrohe) +13mins 50secs
8. Felix Gall (Aut/AG2R) +16mins 11secs
9. Sepp Kuss (US/Jumbo-Visma) +16mins 49secs
10. David Gaudu (Fra/Groupama-FDJ) +17mins 57secs