PLA D'ADET, France -- Poland's Rafal Majka led a late breakaway on the last of four tough climbs in the Pyrenees to win the 17th stage of the Tour de France on Wednesday, as Vincenzo Nibali took another step toward overall victory.

Nibali, who has earned the yellow jersey in every stage but two this year, made his latest case to take it home to Sicily and become the first Italian to win cycling's showcase race in 16 years. He finished third and gained valuable seconds on four of his closest rivals.

Majka, who cheekily winked to a French TV camera with about a kilometre left, tapped his chest, thrust his arms skyward and shouted in joy after giving his Tinkoff Saxo-Bank squad its second straight stage victory after Tuesday's win by Australian Michael Rogers.

"I promised Bjarne today that I would win the stage," said Majka of his team manager, Bjarne Riis.

Wednesday's 124.5-kilometre trek was the shortest stage in this year's Tour, and the second of three days in the mountains along France's border with Spain. It covered three hard Category 1 ascents from Saint-Gaudens and a final push up to Pla d'Adet ski station above the town of Saint-Lary-Soulan.

The Tour's stage finishes at Saint-Lary-Soulan and Pla d'Adet in 2001 and 2005 were respectively won by Lance Armstrong and teammate George Hincapie, who were later stripped of those victories because of doping.

Italy's Giovanni Visconti, whose solo breakaway with about nine kilometres left failed to hold off Majka, was second, 29 seconds back. Nibali was third, 46 seconds behind.

Majka has demonstrated that he's the best climber in this Tour. The 24-year-old Polish rider tightened his grip on the polka dot jersey that is awarded to the race's King of the Mountains, which he was already wearing.

With a last Pyrenean day ahead Thursday, Majka is looking increasingly likely to take home the red-dot jersey. His closest rival as the stage started was Spain's Joaquim Rodriguez, who swatted the air in frustration at Majka when the Pole broke away on the last climb.

Majka said he felt "comfort" in the last five kilometres in part because he'd been saving up energy a day earlier by riding easy. He finished in a pack 24-1/2 minutes behind Rogers.

By Wednesday, "I felt really, really good in the last climb," Majka said in English. "For me, when there are a lot of climbs, it's the best."

Nibali, meanwhile, gained just under a minute on four of his closest rivals. Second-placed Alejandro Valverde of Spain, who made a valiant recovery on the last ascent to avoid even more damage, now trails by 5 minute, 26 seconds.

The exception was Jean-Christophe Peraud of France, who hugged closely on the leader's back wheel and finished fourth. With his performance, the 37-year-old Frenchman made it an even closer race for the podium spots. He is fourth overall, 6:08 behind Nibali, but just eight seconds slower than fellow Frenchman Thibaut Pinot, in third.

American Tejay van Garderen, in sixth, also lost about a minute to Nibali and now trails by 10:19. It came a day after his hopes for a podium spot were dealt a big blow when he lost several minutes to the other aspirants for a top-3 finish in Paris.

"Yesterday was a pity, it was an off day," the American said. A podium spot is still possible, he added, "but it will be hard."

Stage 18's finale in the Pyrenees takes the pack on a 145.5-kilometre loop from Pau to Hautacam, featuring two ascents that are so hard that they defy cycling's ranking system -- one of them an uphill finish.

Then it's a flat stage heading north Friday before an individual time-trial a day later, and then what's likely to be a largely ceremonial ride for the yellow jersey in Stage 21 on Sunday to the Champs-Elysees in Paris for the finish of this 101st Tour edition.

"Considering tomorrow's stage to Hautacam and the time trial, (and) as I was feeling good, I preferred to go and gain a few more seconds and to be even more serene, just in case something could happen," said Nibali of his attacks to gain time Wednesday.

Sixteen years after Marco Pantani won the Tour, at least one prominent Italian seems ready to celebrate. Prime Minister Matteo Renzi has sent Nibali a text message inviting him to the premier's official residence "to celebrate my victory," according to the rider.

Not so fast, responded the ever-cautious Nibali, who admitted he was nevertheless pleased with the message. "I replied that only after winning -- if I do so -- I'll be able to say that I'll be present."