Veteran rider Jens Voigt of Germany, who finished third, took over the race leader's yellow jersey.
Armstrong was riding with the main pack and crossed the finish line 6:04 minutes behind the winner and three minutes behind Voigt and Frenchman Christophe Moreau, who came in second.
Armstrong is now in third place in the overall standings, trailing Voigt by 2:18 minutes and Moreau by 28 seconds. Neither Voigt nor Moreau are considered serious threats for the Tour championship.
The 31-year-old Rasmussen has moved up to fourth place in the standings, 2:43 minutes adrift of the leader.
A former mountain bike world champion, Rasmussen raced the 171 kilometers from Gerardmer to Mulhouse through the Vosges Mountains in 4 hours, 8:20 minutes. In addition to taking his first-ever Tour stage win, he also increased his lead for the Tour climbing title.
He began his attack on the first climb of the stage, after only four kilometers. He was soon joined by Italian Dario Cioni, and the two slowly increased their lead over the main pack.
Rasmussen left Cioni behind near the halfway point of the stage and raced on alone, pursued by Voigt and Moreau, to claim his famous victory.
"It felt very good from the beginning," Rasmussen said. "Originally I just wanted to take points for the mountain standings, but I just kept going. I can't ask for any more."Franck Fife/AFP/Getty Images Mickael Rasmussen rides a 167km solo breakaway for the stage win
The other winner of the day, the 33-year-old Voigt, was equally delighted by taking over the yellow jersey.
"You can't imagine how happy I am," he told France 2 television. "But it cost me a big effort and I think I will pay for it in two or three days. But I have the yellow jersey."
Monday is a rest day for the riders before they attack the first of three grueling stages in the French Alps on Tuesday.
Top 10 results, Stage 9: Gerardmer - Mulhouse (171 km)
1. Michael Rasmussen (DEN/RAB) 4:08:20
2. Christophe Moreau (FRA/C.A) at 3:04
3. Jens Voigt (GER/CSC) 3:04
4. Stuart O'Grady (AUS/COF) 6:04
5. Philippe Gilbert (BEL/FDJ) 6:04
6. Anthony Geslin (FRA/BOU) 6:04
7. Sebastian Lang (GER/GRL) 6:04
8. Laurent Brochard (FRA/BOU) 6:04
9. Jerome Pineau (FRA/BOU) 6:04
10. Gerrit Glomser (AUT/LAM) 6:04
Stage 9: Complete results
Top 10, Overall standings
1. Jens Voigt (GER/CSC) 32:18:23
2. Christophe Moreau (FRA/C.A) @ 1:50
3. Lance Armstrong (USA/DIS) 2:18
4. Michael Rasmussen (DEN/RAB) 2:43
5. Alexander Vinokourov (KAZ/MOB) 3:20
6. Bobby Julich (USA/CSC) 3:25
7. Ivan Basso (ITA/CSC) 3:44
8. Jan Ullrich (GER/MOB) 3:54
9. Carlos Sastre (SPA/CSC) 3:54
10. George Hincapie (USA/DIS) 4:05
Stage 9: Complete overall standings
Stage 9: Category standings