CHORGES, France — Chris Froome narrowly beat Alberto Contador to win the 17th stage of the Tour de France in a rainy time trial and extend his overall lead.

Froome was slower than Contador on the first part of the undulating 20-mile course from Embrun to Chorges in the French Alps on Wednesday. But he gained time on the final section and finished nine seconds ahead of the Spaniard.

Froome made up for missing out last week when he was edged by Tony Martin in the first time trial on Stage 11.

Bauke Mollema held second place overall for several stages, but Contador took his place as the Dutchman dropped down.