Dan Martin finished second on the brutal stage 17 of the Tour de France behind winner Nairo Quintana, but Geraint Thomas kept a firm grip of the leader’s yellow jersey.

This stage was just 65km long, but featured three towering climbs between Bagneres-de-Luchon and Col de Portet. The riders started on a motorsport-style grid as the organisers hoped to disrupt the organisation of the leading teams.

There were attacks from the start of an intense two and-a-half hours racing in the Pyrenees in the South of France and it was Colombian climber Quintana who crossed the finishing line first.

Martin came in 28 seconds behind him and Thomas finished third a further 19 seconds back to single himself out as Team Sky’s leader.

With just one mountainous day and a short time trial left in the four stages before the race finishes in Paris on Sunday, the Welsh rider is strong favourite to win.

His team mate Chris Froome cracked on the final ascent up the Col de Portet and finished 1:35 down on the stage winner.

This means Tom Dumoulin moves into second place to split the two Sky riders, Thomas and Froome, on the podium.

Martin moves up to ninth overall, though he remains nearly a minute and-a-half down on eighth place Romain Bardet, who had a bad day on Wednesday.

Martin pushes himself up the Col de Portet

"The last few days I felt really good, which is a good sign," said Martin.

"I planned to go earlier, but it's okay saying to attack early but with so much wind on those early climbs it wasn't worth it. It was up to Sky to set the tempo at the start of the last climb and they just let me away.

"Nairo came with me and went past me. I tried to ride it like a time trial, but the altitude got me in the end. I was trying to keep him at ten, 15 seconds because over the last 500 metres I'd think I could close that gap, but he was the better rider."

Quintana, who started the day more than four minutes back in the general classification, hauled himself back into the top five with the second Tour stage win of his career.

The Movistar rider attacked close to the foot of the 16km climb as he followed a move launched by Martin, though he quickly shook off the UAE Team Emirates rider who was left to pursue him alone.

Quintana's victory came despite two early mechanicals on a 65km stage - the shortest road stage in the Tour for over 30 years - that was designed to be explosive from the start.

After the stage Froome was involved in an incident with local police, when an officer mistook him for a fan trying to ride the course and stepped in and knocked him off his bike.

Team Sky said Froome was unhurt in the incident.