LA ROCHE-SUR-FORON, FRANCE -- Paris, and victory at the Tour de France, are almost within reach of Primoz Roglic.

The Slovenian rider safely negotiated the last truly mountainous stage of this year's race on Thursday, moving a big step closer to adding what would be his first Tour win to the Spanish Vuelta title he conquered last year.

Polish rider Michal Kwiatkowski won the saw-tooth Stage 18, up and down over a leg-burning succession of five Alpine ascents. His first stage victory at the Tour was also the first at this race for his Ineos Grenadiers team, a consolation prize after its leader, 2019 Tour champion Egan Bernal, withdrew Wednesday having struggled since the weekend.

By avoiding any mishaps on a brutal stage that included a treacherous stretch of gravel path that punctured the thin front tire of another top contender, Australian Richie Porte, Roglic has just two more stages to digest before being able to ride into Paris on Sunday with the yellow jersey on his shoulders to the finish.

Kwiatkowski finished arm-over-arm with teammate Richard Carapaz. They did not sprint to the line, instead crossing together, all smiles, their faces caked with dust, with Kwiatkowski's front tire just ahead. Kwiatkowski is a former world champion and veteran of seven Tours who likely would have won other stages before now had he not devoted much of his career to helping other riders win the Tour title.

Carapaz said Ineos' goals for the day were both winning the stage and putting him in the red-spotted jersey awarded to riders who vacuum up the most points on the Tour's climbs. They did both. With Carapaz having secured the jersey on the ascents, the Ecuadoran rider then graciously left the win to his loyal teammate who had helped him up the climbs.

"Basically, he decided," Kwiatkowski said of Carapaz, who last year became Ecuador's first Grand Tour champion by winning the Giro d'Italia. "He's an incredible person."

"We are going to celebrate big time tonight because we all deserve it after so many stages," he said. "We put in a show today."

Further back, in his own battle to keep the overall race lead, Roglic again kept Tadej Pogacar, his Slovenian countryman and closest rival, firmly in his grasp. Roglic surged ahead of Pogacar on the dusty gravel track at the top of the day's toughest climb, making clear that he was in no mood to cede even seconds so close to the finish in Paris.

Roglic remains 57 seconds ahead of Pogacar overall, and has a lead of 1 minute, 27 seconds over Colombian rider Miguel Angel Lopez, still third.