Chris Froome looked well set not only to stay in yellow but also to win the stage as he was paced up the final kick to the line by Mikel Landa but the race leader cracked in the final few hundred metres.
For the first time in this year's Tour de France a stage ended without a rider from Team Sky wearing the Maillot Jaune, as Fabio Aru snatched the overall race lead.
Chris Froome looked well set not only to stay in yellow but also to win the stage as he was paced up the final kick to the line by team-mate Mikel Landa.
In the end it Landa who finished ahead of his leader, as Froome cracked in the final metres, surrendering the race lead to Astana's Aru. Home favourite Romain Bardet of AG2R La Mondiale took the stage in the dash for the line and picked up valuable time in the GC too.
Home favourite Romain Bardet of AG2R La Mondiale took the stage in the dash for the line
Chris Froome surrendered the yellow jersey in the final few hundred metres as he cracked
British Champion Steve Cummings launched an audacious bid for solo victory on stage 12
1. Fabio Aru (Italy / Astana Pro Team) 52:51:49"; 2. Chris Froome (Britain / Team Sky) +6"; 3. Romain Bardet (France / AG2R La Mondiale) +25"; 4. Rigoberto Uran (Colombia / Cannondale-Drapac) +35"; 5. Daniel Martin (Ireland / Quick-Step Floors) +1:41"; 6. Simon Yates (Britain / Orica-Scott) +2:13"; 7. Mikel Landa (Spain / Team Sky) +2:55"; 8. Nairo Quintana (Colombia / Movistar Team) +4:01"; 9. George Bennett (New Zealand / LottoNL-Jumbo) +4:04"; 10. Louis Meintjes (South Africa / UAE Team Emirates) +4:51"
British champion Steve Cummings looked like he had made an audacious bid for solo victory stick as the race hit the penultimate climb but the punishing pace set by Sky saw him reeled in long before the summit.
Sky's pace on the Col de Peyresourde saw a number of pre-race favourites, including last year's runner-up Nairo Quintana and former champion Alberto Contador, dropped down the mountain.
There was a scare for Froome at the foot of the climb when Sky's Mikel Nieve overshot a turn with his leader and, perhaps fortunately, chief rival Fabio Aru following him between two roadside campervans.
Team Sky drove the pace in the peloton as the race headed into the Pyreneen mountains
The Team Sky riders speed past a field of sunflowers during stage 12 of the Tour de France