Omar Fraile won stage 14 of the Tour de France after overhauling fellow escapee Jasper Stuyven on the steep climb up to the Mende aerodrome.
The pair were among the final survivors of a 32-man breakaway who were 20 minutes ahead of the peloton at the end of the 188km stage from Saint-Paul-Trois-Chateux.
Meanwhile, Irelands' Dan Martin was not with the main group after suffering a puncture one kilometre before the climb, which has led to him dropping down from 9th to 10 in the general classifications.
Trek-Segafredo's Stuyven attacked solo with 35km to go, but ran out of steam on the 12 and 13 per cent gradients out of Mende, and was overhauled by Astana's Fraile around 500 metres from the summit.
Stuyven tried in tandem with Quick-Step Floors' Julian Alaphilippe to respond on the long run-in to the finish, but Fraile had plenty of time to celebrate his first career Tour stage win.
Yellow jersey Geraint Thomas crossed the line more than 18 minutes after Fraile, following Sky team-mate Chris Froome and Team Sunweb's Tom Dumoulin over the line as the top three in the general classification finished in a group.
They were eight seconds behind LottoNL-Jumbo's Primoz Roglic, with the man fourth overall having attacked three kilometres from the finish to gain a slight advantage.
But others struggled, most notably AG2R La Mondiale's Romain Bardet and Movistar pair Mikel Landa and Nairo Quintana. Quintana gave up 10 seconds to Thomas, Bardet 14 and Landa 29.
Adam Yates' recent struggles continued as he was dropped as soon as the road went up.
The provisional general classification showed Thomas retaining his lead of one minute 39 seconds over Froome, with Dumoulin a further 11 seconds back.
Roglic is now two minutes 38 seconds down in fourth, with Bardet's deficit to yellow growing to three minutes and 21 seconds.