Geraint Thomas was in prime position to win his maiden Tour de France after he retained the overall leader's yellow jersey in a lively 19th stage won by Slovenian Primoz Roglic as defending champion Chris Froome slipped down to fourth on Friday.
Roglic powered down the final descent from the Col d'Aubisque to beat Thomas by 19 seconds and leapfrog Froome, whose star continued to fade, into third place overall. Dutchman Tom Dumoulin stayed second ahead of Saturday's decisive individual time trial.
Thomas leads Dumoulin by two minutes and five seconds, Roglic by 2:24 and Froome by 2:37 before the 31-km solo effort against the clock between Saint-Pee-sur-Nivelle and Espelette.
France's Romain Bardet took third place at the end of the 200.5-km mountainous trek from Lourdes after he and Spaniard Mikel Landa attacked more than 100km from the finish.
Former ski jumper Roglic tried to drop Thomas several times in the last climb up to the Col d'Aubisque but the Team Sky rider kept his composure and controlled the situation throughout.
"It's very nice to win today, what can I say. Tomorrow it will be a crucial time trial I will try everything," said Roglic. "I'm surprising myself on this Tour but we're not in Paris yet." In a last attempt to snatch a podium finish in Paris, Bardet and Landa jumped away from the main pack in the ascent of the Col du Tourmalet and they bridged the gap with the breakaway riders in the descent.
Roglic's team mate Robert Gesink pulled hard at the front of the yellow jersey group to reduce the gap from 3:00 to 1:30 in the Col des Borderes before the final climb via the punishing Col du Soulor.
In that section, Dumoulin accelerated but Roglic, Thomas and Froome, his face a mask of pain, jumped on his wheel.
The move hurt Froome, however, as the four-time Tour champion cracked before the top, only managing to come back in the short descent leading up to the Aubisque, where Bardet and Landa were caught by Thomas and the other top favourites.
In the descent, as the riders tore through a thick fog, Roglic found the best trajectories and never looked back, Thomas winning the sprint for second place.
Frenchman Julian Alaphilippe was in the day's breakaway and secured the polka dot jersey for the mountains classification, which he will officially win if he reaches Paris.