Tadej Pogacar emerged above the clouds atop the Pyrenean Col du Portet to extend his overall lead and win stage 17 of the Tour de France on Wednesday after an epic struggle with his two closest pursuers, Jonas Vingegaard and Richard Carapaz.

Ecuadorian Carapaz launched a blistering attack 1.5km from the 2,200m summit finish, but was agonisingly reeled in by the defending champion Pogacar, for whom this was an iconic career moment, winning a tough stage with the overall leader’s yellow jersey already on his back.

After pulverising the field on the stage 5 time-trial the Slovenian took his second victory on this Tour to extend his lead over the surprising Dane Vingegaard to 5min 39sec.

The discreet Carapaz climbed to third overall four seconds back, after Rigoberto Uran was dropped on the final hillside. The Colombian slipped to fourth at 7min 17sec.

“It was the most difficult stage of the Tour, and I dedicate this win to my team who worked so hard for me here,” said Pogacar.

“This Tour isn’t over until the last lap of the Champs-Elysees,” he said when asked if he believed the defence of his title was now sealed.

On the French national holiday of Bastille Day, there were almost as many Slovenian flags on the final climb as French one’s and a healthy smattering of Basque berets were being sported in the huge crowds that lined the slopes.

Storming Bastille Day

French fans had plenty to smile about as FDJ’s home hope David Gaudu came fourth at a finish line above the clouds in this remote bear-inhabited corner of France.

Up-and-coming climber Gaudu raced the stage with the French tri-colour on his helmet.

Another French team AG2R saw their Australian podium hope Ben O’Connor consolidate fifth overall as he rounded out the day’s top five having previously won the Alpine stage to the Tignes ski resort.

AG2R boss Vincent Lavenu said that the stage, with 36km of steep climbing on the final section, was a “race for second place and that half the pretenders will be dropped here.”

It proved to be so, but Ineos man Carapaz, who looked to be struggling after the lead trio broke off from the pretenders 8km from home, kept fighting with his late but fruitless burst.

Before Vingegaard attacked an elite clique on the Mont Ventoux last week he was a relative unknown.

Since then the painfully shy Jumbo man from the remote Danish region of North Jutland has emerged as a serious podium pretender.

With his team down to four riders, he admitted that on Wednesday “the plan was just to follow.”

He cemented his grip on second by surviving the climb up Col du Portet and said he was “relieved, happy and proud” and explained his family were at the finish line.

The leader had warm words for the man on his tail.

“He’s fantastic, a top class rider,” said Pogacar, who like Vingegaard is on his second Tour de France.

“I like racing against him. He’s a super good guy and he could win a Tour de France soon,” Pogacar said.

One last mountaintop finish awaits the riders Thursday before Saturday’s potentially decisive time-trial and Sunday’s parade into Paris.