Geraint Thomas lifted himself to fourth overall following another gutsy ride as Chris Froome fought off attack after attack to preserve his commanding Tour de France lead after stage 17 to Pra Loup.

The Welsh wonder Thomas lifted himself up two places in the overall standings from sixth to fourth as he rose above Alberto Contador, while American Tejay van Garderen retired from the race.

Froome, the 30-year-old Team Sky leader, successfully countered attacks from nearest rival Nairo Quintana (Movistar) early and late on the 161-kilometres route from Digne-les-Bains as German Simon Geschke (Giant-Alpecin) won.

American Andrew Talansky (Cannondale-Garmin) was second and Riogberto Uran (Etixx-QuickStep) third, but the more significant action took place in the Froome group.

Quintana tried to launch an early escape, but Froome’s Team Sky squad hunted him down and when the Colombian climber twice accelerated on the concluding ascent to the small ski resort, Froome chased him down.

Video Loading

Video Unavailable

Click to playTap to play

The video will start in 8Cancel

Play now

Watch: The moment Thomas survives lamp post smash on stage 16

The Kenya-born Briton finished seven minutes 16 seconds behind Geschke on the same time as Quintana to preserve his advantage of 3mins 10secs, with four stages remaining ahead of Sunday’s conclusion in Paris.

This was the first of four stages in the Alps and Thursday’s 186.5km stage from Gap to Saint-Jean-de-Maurienne is sure to provide another test.

But it appears more and more likely that only Quintana stands between Froome and a second yellow jersey after his 2013 win.

Geraint Thomas

Quintana’s team-mate Alejandro Valverde is now third overall, 4:09 behind, after van Garderen (BMC Racing) was forced to abandon midway through the stage through illness.

Alberto Contador (Tinkoff-Saxo) lost time with a crash on the final ascent and sits sixth, 6:40 adrift, one place and six seconds behind Thomas (Team Sky), who had already moved up a place to fifth after Van Garderen’s earlier withdrawal.

"I am pretty surprised to be where I am after everything that's happened," said Thomas.

"I didn't feel super but I managed to hang in there.

"For me it's decent and for Froome even better. At one point we thought about going for the stage but thought 'hold on'.

"The team is strong and we're communicating really well.

"When you look at the GC, Nibali is not a major threat. but when it comes to the final climb he just has to watch Nairo or Valverde."

Quintana made a move on the day's first of five categorised climbs, the category three Col des Leques.

Van Garderen was quickly distanced as it became apparent that all was not well with the American.

He was not the only rider to quit as world champion Michal Kwiatkowski (Etixx-QuickStep), Irishman Sam Bennett (Bora-Argon), Nathan Haas (Cannondale-Garmin) and Jerome Coppel (IAM Cycling) all got off their bikes.

Team Sky, including Welshman Luke Rowe, had Richie Porte and Nicolas Roche in the 24-man breakaway group, which was established after the first ascent, putting the pair up the road to help Froome later in the day.

Contador made a move with Tinkoff-Saxo colleague Mick Rogers on the day's third climb, the 11km category two Col de la Colle-Saint-Michel, but it was swiftly snuffed out.

Luke Rowe (Image: David Davies/PA Wire)

The breakaway group fractured, with Geschke going ahead solo with around 45km to go.

Adam Yates (Orica-GreenEdge) was in close pursuit of Geschke on the day's penultimate climb, the 14km category one Col d'Allos, and next Thibaut Pinot (FDJ) took up the chase.

Pinot, third overall in 2014 but out of contention this year, attacked alone to try to catch the leader.

Geschke had a one-minute advantage over Pinot when he crested the summit, with Froome's group more than 10 minutes adrift.

Nibali's Astana squad led the bunch containing Froome, Quintana, Valverde and Contador over the summit, and the Italian swiftly accelerated to drop Froome's team-mates Thomas and Woet Poels.

Next Quintana surged with the four others following. Porte, dropping back from the break, was able to help the otherwise isolated Froome.

Richie Porte (Image: AP Photo/Peter Dejong)

Up ahead, Pinot's rear wheel slipped underneath him on a left-handed turn, doing little for his reputation at being poor going downhill.

Contador also crashed, allowing Nibali, Froome, Valverde and Quintana to escape on the perilous downhill.

Geschke continued to lead as the 6.2km ascent to Pra Loup began, with Talansky and Uran closest to him.

Geschke held on to win as behind him two Movistar riders dropped back from the fragmented escape group to help Quintana and Valverde andone Astana rider dropped back to support Nibali, outnumbering Froome.

Quintana accelerated with around 3km to go, but Froome snuffed out the move.

The Colombian surged once more with 500m to go, but could not shake Froome, who will face further tests in the coming days.