There was a home winner on the eighth stage of the Tour de France while Vincenzo Nibali remains in the yellow jersey after a thrilling battle with Alberto Contador.

Blel Kadri dragged himself over the line, rain soaked, after a 161km ride from Tomblaine to Gerardmer La Mauselaine, his victory itself a story as he went solo after being part of a breakaway that had featured gutsy Brit Simon Yates.

But as Frenchman Kadri crossed the line, Nibali had to dig as deep as he could to stay with Contador who, with a kilometre or so to go, tried to drop the Astana rider.

All he saw was a magnificent response from Nibali, who went with him and lost just three seconds of his overall lead to the Spaniard, but increased it to a minute and 44 seconds over second-placed team-mate Jakob Fuglsang.

Contador is two minutes and 34 seconds down in sixth, while Team Sky's new leader Richie Porte moved up to third overall, although he has lost four more seconds to Nibali, trailing by a minute and 58 seconds.

For so long it had looked as though Bury's Yates would be in the mix at the end, sticking with the breakaway he joined 35 kilometres in until they approached the gruelling climax of the first of three successive days in the Vosges.

The final 30 kilometres saw the category climbs of the Col de la Croix des Moinats and the Col de Grosse Pierre, while the steep finish at La Mauselaine did its best to separate the challengers from the rest.

Yates battled gamely but was duly eaten up by the peloton, with Contador, Nibali and Porte emerging as the big three as the Tour reaches its one-week mark.

The big loser was Andrew Talansky, who crashed on the ride down the Grosse Pierre, losing over two minutes on his yellow jersey rivals.

It was a positive day for Porte, who is adapting to the role of Sky's main man after defending champion Chris Froome was forced to pull out due to injury.

Speaking to ITV4, he said: "I'm happy with how that went, it is not really my bread and butter and I think that on the longer climbs I will be better."

He acknowledged that the aggressive riding of Contador's team had changed the landscape, though.

"Tinkoff Saxo are riding very aggressively from a long way out, a bit like Team Sky used to do," he said.

Sunday's ninth stage is a 170-kilometre hike from Gerardmer to Mulhouse.