At the end of a long mountain stage which came down to a final sprint for the line in Peyragudes, Aru accelerated with around 300m to go, instantly putting the yellow jersey of Froome in trouble.
Aru's burst for the line was followed by Romain Bardet (Ag2r La Mondiale) and Rigoberto Uran (Cannondale-Drapac) on the 16 per cent slopes of the ski resort's airstrip, with Bardet coming through in the final 50m to take the stage win.
Meanwhile Froome struggled with the explosive effort required for the final sprint, swerving across the road as he eventually finished in seventh place, 22 seconds behind Bardet and 20 seconds behind Aru.
That result meant that Froome slipped to second in GC, six seconds behind Aru, with Bardet now just 25 seconds back in third.
How it happened
The opening 20km saw aggressive racing before a strong 12 rider move went clear. In the move were Cyril Gautier (Ag2r-La Mondiale), Imañol Erviti (Movistar), Koen De Kort (Trek-Segafredo), Stefan Küng (BMC Racing), Diego Ulissi (UAE Team Emirates), Steve Cummings (Dimension Data), Marcel Kittel and Jack Bauer (Quick-Step Floors), Nils Politt (Katusha-Alpecin), Thomas De Gendt (Lotto-Soudal), Michael Matthews (Team Sunweb) and Julien Simon (Cofidis).
That group steadily built an advantage of just over five minutes to the peloton, which was controlled by Team Sky for the flat first half of the stage as the riders endured wet weather on the way into the Pyrenees.
The only real action of the early part of the stage came at the intermediate sprint after 94km, where Matthews edged out Kittel to trim the German's lead in the race for the green jersey from 133 to 130 points.
Beyond the midpoint of the stage and Sky continued to set the pace on the Col des Ares and the Col de Menté, Luke Rowe and Christian Knees keeping the gap to the break locked at around six minutes. At the top of the climbs De Gendt took maximum points on the Col des Ares, before losing out to Matthews, trying to protect the lead of team-mate Barguil in the mountains classification, on the Col de Menté.
The valley roads ahead of the Port de Balès saw the gap drop towards four minutes, before the break started to splinter a few kilometres in to the HC climb.
De Gendt upped the pace to shed some of the weaker climbers from the break, initially followed by Küng, Gautier, Cummings, Bauer, and Simon, before accelerating once again, a move that only Cummings was able to follow.
Meanwhile Vasil Kiryienka was working hard on the front to slowly bring down the gap to the leaders and also drop fifth place rider Jakob Fuglsang (Astana) who was suffering after breaking his wrist and elbow on a crash on stage 11.
Kiryienka pulled off with a few kilometres remaining, which seemed to be a signal for the first of the GC attacks as Alberto Contador (Trek-Segafredo) followed a move by Warren Barguil. However the move was short-lived as Michal Kwiatkowski slowly raised the pace to bring them back.
There was also action at the front of the race, with Cummings going clear of De Gendt and setting off in search of his third Tour breakaway victory in as many years.
By the top of the climb Cummings' advantage was up to around 1-30 over De Gendt, who was then joined by Barguil on the descent before both riders were caught by the Sky-led peloton.
The technical descent saw Sky unwilling to take risks, which allowed Cummings to extend his lead out beyond two minutes by the start of the Col de Peyresourde with 15km remaining.
The main group made it all the way to the base of the Peyresourde without incident, but on the final corner to turn onto the climb Mikel Nieve misjudged a corner, going straight on between two motorhomes, leading Froome and Aru off the road too. Somehow all three riders managed to stay upright, quickly chasing back up to the rest of the GC contenders who decided to wait for the yellow jersey and his main rival.
That incident allowed Cummings' lead to stay around two minutes for the first few kilometres of the climb, the British champion looking reasonably comfortable and pedalling with a high cadence as the gradient hovered around eight per cent.
Not looking quite so comfortable was Nairo Quintana (Movistar), who was dropped early on the climb with Kwiatkowski still toiling away on the front.
With 10km remaining Kwiatkowski's work was done, leaving Nieve to take over as Cummings' lead came below a minute for the first time in the race, and from there falling rapidly as he was caught just over a kilometre later.
Nieve continued to lead for the rest of the climb as the expected attacks from Froome's GC rivals failed to materialise and Contador was dropped just 500m from the summit.
The Basque rider continue to lead onto the final climb to Peyragudes, before handing over to Landa for the final two kilometres.
Landa led until around 300m to go when Aru attacked. The Italian was followed by Uran and Bardet, but Froome instantly looked in trouble, and while his rivals powered towards the line, the yellow jersey swerved left and right across the steep airstrip.
In the final hundred metres Aru was overhauled first by Bardet and then by Uran, the former taking the third Tour de France stage win of his career, while Froome fought to the line to limit his losses.
Tour de France 2017, stage 12: Pau to Peyragudes (214.5km)
1. Romain Bardet (Fra) Ag2r La Mondiale, in 5-49-38
2. Rigoberto Uran (Col) Cannondale-Drapac, at 2 secs
3. Fabio Aru (Ita) Astana, at 2 secs
4. Mikel Landa (Esp) Team Sky, at 5 secs
5. Louis Meintjes (RSA) UAE Team Emirates, at 7 secs
6. Daniel Martin (Irl) Quick-Step Floors, at 13 secs
7. Christopher Froome (GBr) Team Sky, at 22 secs
8. George Bennett (NZl) LottoNl-Jumbo, at 27 secs
9. Simon Yates (GBr) Orica-Scott, at 27 secs
10. Mikel Nieve (Esp) Team Sky, at 1-28
General classification after stage 12
1. Fabio Aru (Ita) Astana Pro Team, in 52-51-49
2. Christopher Froome (GBr) Team Sky, at 6 secs
3. Romain Bardet (Fra) Ag2r La Mondiale, at 25 secs
4. Rigoberto Uran (Col) Cannondale-Drapac, at 35 secs
5. Daniel Martin (Irl) Quick-Step Floors, at 1-41
6. Simon Yates (GBr) Orica-Scott, at 2-13
7. Mikel Landa (Esp) Team Sky, at 2-55
8. Nairo Quintana (Col) Movistar, at 4-01
9. George Bennett (NZl) LottoNl-Jumbo, at 4-04
10. Louis Meintjes (RSA) UAE Team Emirates, at 4-51
Thank you for reading 20 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1