(CNN) -- Alberto Contador will take a 39-second lead into the final stage of the Tour de France after fighting off a determined challenge from Andy Schleck in Saturday's deciding time trial stage.
Spain's Contador had an eight-second advantage going into the 52km solo test from Bordeaux to Pauillac and came under pressure from his Luxembourg rival at the early time checks.
For some fleeting moments it seemed possible that Schleck could reclaim the yellow jersey, but as he tired, Contador, considered a far superior time triallist, increased his advantage.
And at the finish, a relieved and tearful Contador had extended his lead by 31 seconds.
"It was a very hard day. I've worked so hard for so many years but today it really came right down to the wire. That's why I'm so emotional," Contador told the official race website.
"In fact, I think it's the first Tour I've won where I've been so emotional.
"I want to thank all the people who have been there for me these last years."
Both the top two were well adrift of the best time of Schleck's Saxo Bank teammate Fabian Cancellara.
He powered around the course in one hour and 56 seconds to win the 19th stage by 17 seconds from Tony Martin whose HTC-Columbia teammate Bert Grabsch finished third.
Russia's Denis Menchov will claim the final podium position in Paris after leapfrogging Olympic road race champion Samuel Sanchez of Spain for third overall with the best time trial performance of the leading contenders, who had to battle a rising wind over largely flat terrain.
Assuming no accidents on the 20th and final stage into the French capital on Sunday, it will be the third Tour de France triumph for Astana's Contador after his 2007 and 2009 triumphs.
He courted controversy by taking the overall race lead in the Pyrenees on Monday after Schleck dropped his chain near the summit of a climb.
Contador flouted recent convention by not waiting for him to fix the problem and was later jeered by fans as he donned the yellow jersey.
Contador had gained 39 seconds on Schleck, ironically the margin that will likely separate them at the finish in one of the closest fought Tours in recent years.
Their head-to-head duel on the Col du Tourmalet in Thursday's final mountain stage will long be remembered, with Contador making a sporting concession to allow Schleck to claim the victory while maintaining his slender but decisive advantage.
Schleck said he is determined to return next year to win the Tour de France.
"I've always said I've progressed (in the time trial) but to beat Alberto is not easy. I gave it my all, and I just couldn't beat him," he said.
"I've won two stages here, so for that I'm happy. I will come back next year to win. He is not unbeatable."