Alberto Contador is poised to win his third Tour de France. ((Laurent Rebours/Associated Press))

Alberto Contador is set to win his third Tour de France title in four years after retaining the yellow jersey in the next-to-last stage on Saturday into Pauillac.

Fabian Cancellara won the time trial, but the 27-year-old Contador held on to his razor-thin lead over Andy Schleck of Luxembourg, who had started the 19th stage in second place, eight seconds back.

"I am very moved … It was a difficult Tour and I'm very happy," said Contador, who wiped away tears, took a deep breath and finger-pistoled the crowd — his trademark gesture — with a trembling hand after donning the yellow jersey.

"I think it's the first Tour that has given me so much emotion, you can't imagine."

Schleck said he had no regrets.

"Beating Contador is not easy, but I tried everything," he said. "I am happy, and I'll come back next year to win."

Riders set off one by one down a starter's ramp for the 52-kilometre race against the clock that set the final positions on the podium. Schleck is set to finish second to Contador for the second straight year.

Cancellara, one of the world's top time-trial riders, won by outpacing Tony Martin of Germany, who was second, 17 seconds back. Bert Grabsch of Germany was third, 1:48 seconds behind the winner.

Contador was 35th, 5:43 back, while Schleck finished 44th, 6:14 behind Cancellara. That 31-second difference extended the Spaniard's overall lead to 39 seconds.

Victoria rider gains a spot

Ryder Hesjedal of Victoria moved up one spot to seventh after finishing 52nd in the stage, while Michael Barry of Toronto remained 99th after an 80th-place ride.

Spaniard Carlos Sastre of the Canadian-owned Cervelo Test Team is 20th.

It was a day of duels.

Denis Menchov of Russia, who won the 2009 Giro d'Italia, mounted an impressive time trial and overcame Samuel Sanchez of Spain to wrest third place overall.

Menchov had begun the day in fourth, 21 seconds back of Sanchez, but nearly four minutes behind Contador and Schleck. The Russian finished 11th — 3:51 back of Cancellara — and Sanchez was 40th, 5:51 behind.

Overall, Menchov trails Contador by 2:01, and Sanchez fell to fourth, trailing his compatriot by 3:40.

Barring catastrophe, Contador is all but certain to win the race in the 20th and final stage on Sunday — a 102.5-kilometre trek from Longjumeau to the Champs-Elysees in Paris.

By tradition, the last stage has become a largely ceremonial ride — and any attempt at attacks would likely be quashed by Contador and his Astana teammates.

In the other race categories — assuming the riders and teams finish on Sunday — France's Anthony Charteau has locked up the polka-dot jersey for the race's best climber; 25-year-old Schleck will take home the white jersey for being the best young Tour rider for a third straight year and Team RadioShack is set to win the team competition.

The last remaining question lingers over the fate of the green jersey, given to the best race sprinter based on a points system, because Sunday's stage is likely to end in a sprint. Alessandro Petacchi — a 36-year-old Italian — currently is favoured to win that shirt.