Spain and Cofidis at the double as Ion Izagirre wins Tour de France stage 12
The Basque rider went solo in the last short climb of the day, 30km from the finish, and never looked back to claim a second career Tour stage win.
Izagirre, who won the 20th stage of the Tour in 2016 in Morzine, is the second Spanish rider to win this year after Pello Bilbao on Tuesday and the second from the Cofidis team after Victor Lafay in the second stage.
Spain had not won a Tour stage since 2018 and French outfit Cofidis had started the race without a victory since 2008.
Defending champion Jonas Vingegaard of Denmark retained the overall leader's yellow jersey and leads Slovenian Tadej Pogacar by 17 seconds and Australian Jai Hindley by 2:40.
France's Thibaut Pinot, who featured in the day's breakaway, moved up from 15th to 10th overall, now 6:33 off the pace.
A top climber, the Groupama-FDJ rider was however unable to follow Izagirre when the Spaniard attacked and dropped everyone in impressive fashion.
"He's one of the engines of the team. He passes on his ambition to his team-mates," Cofidis team manager Cedric Vasseur, who recruited Izagirre last year, said.
"Today we had decided to put several riders in the breakaway and the presence of Guillaume Martin in it helped us.
It took us years to win a stage on the Tour (after 2018) and this year we already have two, it's amazing. What a day, what a Tour."
After countless foiled attempts, a 15-man breakaway took shape midway through the stage, which got to an explosive start with the chasing pack reduced to some 40 riders.
All the top guns were in there but Vingegaard's Jumbo Visma and Pogacar's UAE Emirates teams let the advantage grow to 3:30 until AG2R-Citroen started pulling in front in a dodgy strategic move as they had virtually no chance of bridging the gap.
Mathieu van der Poel jumped away from the leading group, followed by Andrey Amador but the Dutch rider went solo before the Col de la Croix Montmain (5.5km at 6.1%).
He had 20 seconds at the top but Pinot and Matteo Jorgenson came back in the Col de la Croix Rosier, only for the trio to be reined in by a group of six.
Izagirre attacked 2.4km from the top and never looked back, leaving France's Mathieu Burgaudeau and Jorgensen over a minute behind to finish second and third respectively.
Friday's 13th stage should see the top guns resume their battle as it will take the peloton up to the Col du Grand Colombier at the end of the lung-busting 17.4-km ascent at 7.1%.