Weening still led, meanwhile, under the 2km to go kite on the snow-lined roads approaching the summit but De Gendt closed in fast behind.
At the same time, Tejay van Garderen (BMC Racing ) got a gap on the bunch and the American’s move – and Alberto Contador’s subsequent chase – split the already reduced peloton, catching Team Sky out.
De Gendt passed Weening with ease at the front, while the attacks in the what was left of the peloton continued – Richie Porte (BMC Racing) kicking next.
As De Gendt passed under the flamme rouge, a quartet of Nairo Quintana, Alberto Contador and the BMC Racing duo formed in front of the peloton, but Van Garderen and Porte could not use the advantage.
Instead Quintana and Contador kicked on again, catching Erviti who had nothing left to offer his Movistar team-mate.
Nevertheless, as De Gendt was celebrating his stage victory, Quintana left Contador behind to claim second place and the leader’s jersey.
Porte beat Alberto Contador to the third bonus seconds, but Quintana leads the way with three stages remaining.