PLA D'ADET, France -- On the last of four Pyrenees ascents, Rafal Majka winked at a French TV camera and tugged playfully at a motorcycle's antenna.

Even this late in the Tour de France, the Polish rider made winning look easy as he took Stage 17 Wednesday.

For Vincenzo Nibali, the second ride in the mountains on France's border with Spain was more serious. "The Shark" nibbled yet more seconds away from several of his closest challengers, and the yellow jersey that he's worn for all but two days of this race seemed to fit just a little more tightly ahead of Sunday's race finish in Paris.

Nibali was even businesslike with his own prime minister, imploring him not to get too ahead of himself in celebration.

Wednesday's 77-mile trek was the shortest stage in this year's Tour. 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.

Majka, who also won Stage 14 in the Alps, again showed he's the best climber and tightened his grip on the polka dot jersey, which is awarded to the race's King of the Mountains.

Giovanni Visconti got the action going on the last climb, but his solo breakaway with about 51/2 miles left could not hold off Majka. Visconti was second, 29 seconds back, and Nibali was third.

With a last Pyrenean day ahead today, Majka could ensure that he takes the red-dot jersey home. His closest rival for it when 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 kilometers in part because he'd been saving up energy a day earlier by riding easier. He finished in a bunch 24-1/2 minutes behind Australian teammate Michael Rogers, who won Stage 16.

By Wednesday, "I felt really, really good in the last climb," Majka said, after tapping his chest, thrusting his arms skyward and shouting in joy at the victory. "For me, when there are a lot of climbs, it's the best."

There was a time when seemingly effortless victories smacked of something more sinister at the Tour: the use of performance-enhancers.

Few know the scars of cycling's doping past more than Majka's own manager at the Tinkoff-Saxo Bank team, Bjarne Riis. Once a national hero in Denmark after winning the 1996 Tour, he admitted to using blood-booster EPO more than a decade later -- and was vilified for it. He laid low for a while, but then returned to the pro cycling world.

"I promised Bjarne today that I would win the stage," said Majka.

The echoes of doping resonated Wednesday on the grassy Pyrenean mountainside: The last times that Saint-Lary-Soulan hosted a Tour stage finishes were in 2001 and 2005 -- won by Lance Armstrong and teammate George Hincapie. Those wins were later stripped because of doping. Their names have been crossed out in the official Tour history book.

Cycling has made great strides in fighting doping with enhanced blood and urine testing, along with the biological passport program, but few experts would claim that the peloton today is entirely clean.

Nibali, who has called himself a "flag-bearer of anti-doping", made his latest case to become the first Italian to win cycling's showcase race in 16 years -- since Marco Pantani, who was once convicted for doping.

Nibali 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 BMC leader 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-kilometer (90-mile) 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 northward Friday before an individual time-trial a day later, and then what's likely to be the 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.

While well-positioned to be in yellow then, Nibali was still attacking Wednesday.

"I preferred to go and gain a few more seconds and to be even more serene, just in case something could happen," he said.