Fabian Cancellara of Switzerland won the 32-mile individual time trial, but Contador extended his slim lead over Andy Schleck of Luxembourg, who started the 19th stage 8 seconds behind.
"I am very moved. ... It was a difficult Tour and I'm very happy," Contador said.
After donning the yellow jersey, the 27-year-old Spaniard wiped away tears and took a deep breath. His hand trembled as he made his trademark gesture to the crowd - pretending to shoot with his finger.
"I think it's the first Tour that has given me so much emotion, you can't imagine," he said.
Schleck now trails by 39 seconds and is to finish second to Contador for the second straight year.
"Beating Contador is not easy, but I tried everything," he said. "I am happy, and I'll come back next year to win."
Barring a wild turn of events, Contador is all but certain to win the race in the 20th and final stage Sunday - a 64-mile ride from Longjumeau to the Champs-Elysees in Paris. The last stage has become largely ceremonial, and any attempt at attacks likely would be quashed by Contador and his Astana teammates.
Seven-time champion Lance Armstrong, who is riding in his last Tour and ruled himself out of contention after crashing and struggling in the first day in the Alps in the eighth stage 8, will be going out with a whimper.
The 38-year-old Texan, who once dominated time trials, finished Saturday's stage in 67th place, 7:05 behind Cancellara. Overall, he is 23rd - 39:20 behind his former teammate and rival Contador.
Armstrong returned to a RadioShack team car and left without speaking to reporters after the stage.
Riders set off one by one down a starter's ramp for the race against the clock that set the final positions on the podium. Cancellara, one of the world's top time-trial riders, outpaced Tony Martin of Germany, who was 17 seconds back in second place. Bert Grabsch of Germany was third, 1 minute, 48 seconds behind the winner.
Contador was 35th, 5:43 back, while Schleck finished 44th, 6:14 behind Cancellara. That 31-second difference allowed the Spaniard to widen his overall lead.
Denis Menchov of Russia, who won the 2009 Giro d'Italia, mounted an impressive time trial and overcame Samuel Sanchez of Spain to secure 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.
In the other race categories - assuming the riders and teams finish Sunday - France's Anthony Charteau has locked up the polka-dot jersey for the race's best climber; the 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 looks likely to win that shirt.
Cancellara, a Saxo Bank teammate of Schleck's, nearly bookended his Tour with stage victories - he also won the short prologue in Rotterdam, Netherlands, and held the yellow jersey for a total of six days.
This race has fortified Schleck's standing. Long written off as not being among the best in time trials, he won the time trial in his national championship last month.
Coming into Saturday's stage, Schleck and many others believed that he would need the time trial of his life - or for Contador to have a really bad day, a crash, or some other mishap.
Contador won the last time trial of the 2009 Tour and was 1:45 faster than Schleck. Contador went on to win the Tour and Schleck was runner-up - 4:11 behind.
At the first time check Saturday, at 11 miles, Schleck clipped two seconds off his deficit to Contador, though both men were still about 90 seconds behind Cancellara.
But by the second and third time checks, Contador gained on his rival from Luxembourg. By the second check, 22 miles, he was seven seconds faster. By the third, near the finish, he led by 17 seconds.
After more than 2,175 miles of racing, Contador held a minuscule lead - laying the groundwork for yet another narrow victory. Only a handful of Tours have been decided by less than a minute.
In 2007, when Contador won for the first time, he outpaced Cadel Evans of Australia by only 23 seconds. In that tightest Tour finish, American rider Levi Leipheimer placed third, 31 seconds behind the Spaniard.
The 2010 margin is set to be one of the narrowest in the race's 107-year history. The record is the 8-second gap Greg Lemond of the U.S. held over Laurent Fignon of France in 1989.