Froome kept control of his rivals in a gruelling Alpine ride to move a step closer to a fourth Tour de France title on Wednesday, retaining the leader's yellow jersey after the 17th stage.
The defending champion was attacked by last year's runner-up Romain Bardet and Ireland's Dan Martin in the lung-busting ascent to the Col du Galibier but he stayed calm and covered every offensive move.
Bardet and Martin's accelerations, however, were damaging for Fabio Aru as the Italian lost 31 seconds and slipped from second to fourth place overall.
Froome leads Colombian Rigoberto Uran and Bardet by 27 seconds each, while Aru is now 53 seconds off the pace.
Roglič held the group of main contenders off to become the first Slovenian to win a Tour stage, crossing the line 1:13 ahead of Froome, Bardet, Uran and Frenchman Warren Barguil, who consolidated his grip on the polka dot jersey for the mountains classification.
German Marcel Kittel, holder of the green jersey for the points classification, abandoned the race after a crash. New leader Australian Michael Matthews looks likely to wear the jersey all the way to Paris thanks to his big lead over second-placed Andre Greipel.
Reuters