Chris Froome conceded four seconds to Romain Bardet on the Col d'Izoard but nevertheless took another step towards his fourth Tour de France title as Warren Barguil took victory on stage 18.
Froome was alongside Bardet on the finish line, but it was the Frenchman who finished third behind Barguil and Darwin Atapuma to collect four bonus seconds and trim his deficit in second place to 23 seconds.
Colombian Rigoberto Uran, who began the day level with Bardet in the General Classification, was a further two seconds back on the road and now trails Great Britain ace Froome by 29 overall.
Though Froome has seen his advantage cut slightly, the main goal was to retain yellow on the final summit finish of this year's Tour.
"It was a really hard stage especially in the final kilometres," Froome said.
"But I'm really happy with today. I tried to drop Bardet and Uran but it was almost impossible to do so."
The Team Sky rider must now defend his lead over relatively flat territory on today's stage to Salon-de-Provence before tomorrow's time trial in Marseille, where he is expected to gain time.
Only six yellow jersey winners have won the Tour without claiming a stage along the way - and Froome will aim to avoid joining that list tomorrow.
"I'm pleased to get through the Alps without any problems this year, because it's always the Alps that I find the hardest," he admitted.
"I'll do my best to win the stage and to keep the yellow jersey in Marseille. I've seen the route, it's fast and as its only 22 kilometres, it's not that long. I'll give it my best shot."
For Barguil, the stage victory - his second of this year's Tour - underlined his superiority in the King of the Mountains Classification, which he has mathematically wrapped up, needing only to safely make it to Paris.
"I'm living inside my dream at the moment, it's crazy," he said afterwards.
"After all my bad luck I can show another side to everybody."
But others suffered on the climb. Italian national champion Fabio Aru was dropped again, conceding over a minute as the former yellow jersey holder in this race slipped to fifth in the General Classification behind Froome's team-mate Mikel Landa and almost two minutes adrift of the race lead.
Bury's Simon Yates conceded another 25 seconds to South African rival Louis Meintjes in the Young Riders' Classification, but the Orica-Scott rider still holds the white jersey by a handy margin of two minutes and six seconds.
"I'm pretty happy," Yates said. "I had much better legs than yesterday and didn't lose as much time. I think it was a positive day.
"I'm more confident (of keeping the white jersey) after today but there are still hard days to come and the time trial on Saturday, so we'll have to see."
Irishman Dan Martin was active in forcing the pace on the Izoard, and finished within 19 seconds of Bardet and Froome to retain sixth place overall.
The 179.5km stage from Briancon saw a 54-man breakaway go up the road early on, but did not come to life until the imposing climb of the Izoard, 14.1km long at an average gradient of 7.3 per cent as it took the peloton to a height of 2,360m.
Team Sky tried to tease Bardet (AG2R La Mondiale) and Uran (Cannondale-Drapac) into making a move as they sent Landa up the road shortly after.
Bardet took the bait with three kilometres to go, but Froome followed him and briefly dropped him on the short descent at Casse Deserte, two kilometres from the top.
For a moment it appeared the fight for yellow was over as he swiftly gapped the others, but the distances were deceptive and instead the decisive move came when Bardet attacked with 400m left.
That was enough to get Bardet - runner up to Froome 12 months ago - four extra seconds and sole ownership of second place.