The stage win was Armstrong's third in three days and fourth at this Tour matching his previous best. The Texan could get a fifth stage win at a time trial on Saturday.
Armstrong, distinctive in his overall leader's yellow jersey, launched himself into top gear within sight of the line to sprint past German champion Andreas Kloden, winning by inches.
"No gifts this year," the five-time champion said. "I want to win."
Even Armstrong seemed to find his victory hard to believe. A wide smile on his face, he jubilantly thrust his fists into the air as he zoomed past Kloden, who had seemed destined to win until Armstrong found the extra burst of speed.
The win, coming at the end of one of the hardest mountain stages this year, gave Armstrong bonus seconds that extended his overall lead on Italian Ivan Basso.
German Jan Ullrich was third in the sprint, followed by Basso.
Both in the mountains and, on Thursday, in a sprint, Armstrong has been in a different class than his rivals. His lead of four minutes and nine seconds over Basso should easily carry him through to the podium in Paris on Sunday.
By the end of the final climb Thursday, just Basso, Kloden and Ullrich had managed to stay with Armstrong and his teammate Floyd Landis, who worked tirelessly to steer his leader up the ascent.
At the summit, Armstrong reached an arm over to Landis and gave him the green light to try to win. The finish was eight miles away, at the end of a long speedy descent from the climb.
"I spoke to Floyd at the summit and asked him, 'How fast are you in the descent?' He said, 'Very, very quick,' and I said, 'Go! go!"' Armstrong said.
Landis zoomed away but was quickly caught by Ullrich, which prompted Armstrong to catch up, followed by Basso and Kloden.
The five riders jostled for position as they sped through the final corners leading to the finish at Le Grand-Bornand in the Alps. As the line neared, Kloden suddenly spurted ahead and the stage seemed his.
But for Armstrong, the chance for another victory at his favorite race was simply too hard to pass up. With one final glance over his shoulder, he rocketed off in pursuit and found just enough speed to edge Kloden at the line.
"The Tour de France is so special," Armstrong said. "My form is super."
Armstrong dedicated his win to Landis, who rode strongly for his leader Thursday but finished last in the sprint.
"I really wanted him to win the stage," the Texan said.
Armstrong now has 20 individual stage victories. He also has two collective wins, taking the team time trial with his U.S. Postal Service squad both this year and last.
The other years when Armstrong won four stages in a single Tour were 1999, his first victory after a comeback from cancer, and in 2001 and 2002.