Mark Cavendish of Britain collected his sixth stage win of this year's Tour in a sprint after the 101.9-mile course ride from Montereau-Fault-Yonne to the Champs-Elysees.
Over nearly 3,500 kilometers and 21 stages of racing over three weeks, Contador repelled many challenges in the mountains, excelled in the two time-trials - winning a pivotal race against the clock in the 18th stage - and won the first Alpine stage.
Andy Schleck of Luxembourg, Contador's biggest rival among title contenders in the mountains, was second overall.
Contador, the 2007 champion, also had to battle a rearguard action within his Astana team, where the comeback of Armstrong to the Tour after 3½ years of retirement raised questions about who would be the team leader.
"It has been an especially difficult Tour for me, but I savor it and it is more special because of it," Contador said after the Spanish national anthem was played.
Asked on French TV what the hardest moment in this race, Contador replied: "It was in the (team) hotel," without elaborating.
Contador and Armstrong reportedly had differences early in the race, as tensions grew over who was the No. 1 Astana rider.
"We are totally incompatible. In the end, Armstrong will go his way and I'll go mine," Contador said.
The Spaniard did enjoy this victory more than in 2007. Four days from the finish that year, then race leader Michael Rasmussen of Denmark was sent home for lying about his whereabouts during pre-Tour doping controls.
"In the key stages of this Tour, I found myself feeling more at ease than I did in 2007. But in situations outside of racing, I didn't feel so comfortable," Contador told Spanish broadcaster TVE.
After Oscar Pereiro's victory in 2006 and Carlos Sastre's in 2008, the Tour has been won by a Spaniard for four straight years.
Contador began the Tour on July 4 as the pre-race favorite. At only 26 years old, he is already one of cycling's greats, having won all three Grand Tours of France, Italy and Spain.
He had to sit out last year because of a doping scandal at Astana before he joined.
Contador finished in 85 hours, 48 minutes, 35 seconds. The race looped from Monaco, across the Mediterranean rim into Spain, up the Pyrenees, diagonally across central and northeastern France to the Alps, and then down to Saturday's race climax on the dreaded Mont Ventoux in southeast France before the Paris finish.
Schleck was 4:11 seconds behind. Armstrong was 5:24 back.
After three straight Tours decided by less than a minute between first and second place, Contador's margin of victory was the largest since Armstrong collected his last title in 2005.
The 24-year-old Schleck won the white jersey awarded to the Tour's best young rider. Franco Pellizotti of Italy picked up the polka-dot jersey given to the race's King of the Mountains.
Armstrong, the 37-year-old seven-time Tour champion, is the second-oldest rider to reach the Tour podium. Raymond Poulidor of France was 40 he placed third in 1976.
Cavendish set his own record: no rider has ever won six Tour stages in a sprint. But Thor Hushovd of Norway beat the 24-year-old Briton for the green jersey given to the Tour's best Tour sprinter.
Cavendish made it look easy, winning by several bike lengths in the last mad dash, trailed in second by his own lead-out man on the Columbia team, Mark Renshaw. Tyler Farrar of the United States was third.
"For sure, winning on the Champs-Elysees is a dream for every single sprinter - to see the Arc de Triomphe in the distance," said Cavendish, acknowledging it would have been a "bonus" to take home the green jersey.
"I can't go home from this Tour being disappointed - I won six stages," he added.
For more info:
By Associated Press Writer Jamey Keaten