Froome had kept at the front of the bunch on a speedy downhill section over the final 10km before finding himself ideally placed to attack the 600-metres uphill finale and it proved to be a great day as he took back the yellow jersey from Italian Fabio Aru.
Back in yellow
"It's good to be back (in yellow) and really unexpected. It's such an amazing feeling after a tough day in the Pyrenees (on Thursday) to get it back," said Froome, the reigning champion.
"It definitely was not the plan to lose the jersey and I definitely didn't expect to be back in the yellow jersey after today's stage.
"I knew the final would be selective but I didn't expect to be taking these time margins from my rivals."
Froome finished seventh, one second behind Matthews but four seconds ahead of Romain Bardet and Simon Yates, 21 seconds ahead of Nairo Quintana and 24 seconds clear of Aru.
Only Dan Martin and Rigoberto Uran of the top 10 finished alongside Froome, in eighth and ninth respectively.
Froome now leads Aru by 18 seconds, the exact same lead he'd enjoyed over the Italian before cracking on the brutally steep uphill finish to Thursday's Pyrenean mountain stage when he finished 22 seconds behind stage winner Bardet.
The top 10 are still bunched closer together than they were before the Pyrenees despite Froome's gains, with Bardet third at 23sec, Uran fourth at 29sec, Spaniard Mikel Landa fifth at 1:17, and Martin sixth at 1:26.
At the finish line sprint Philippe Gilbert led the way but he was overtaken by Olympic champion Greg Van Avermaet and then Michael Matthews.
The Australian comfortably won ahead of Belgian Van Avermaet with Norway's Edvald Boasson Hagen third.
"I targeted this stage from the beginning of the year, I've been gearing my efforts around that finish and it came true," said Matthews.