“This just confirms my great start to the season,” Chavanel, who showed his pace by winning two Flemish one-day classic races in the spring, said.
“I would never have believed it this morning because last night I had problems with my back. Now, I am the happiest man in the world.”
The riders will next face a 53km time trial on Saturday, with Sastre enjoying a 1:34 lead over Cadel Evans, an Australian.
“Tomorrow is the most important day for me but the fact I am starting last from the field should help me,” he said.
Sastre has held the yellow jersey since Wednesday, when he won the 17th stage to Alpe d’Huez.
“I will be paying close attention to Cancellara’s times because he will be the big reference for everyone,” he said, referring to his team mate Fabien Cancellera.
“For me, the pressure is on Evans. He is the one who has to try and win the yellow jersey tomorrow.”
Leonardo Duque, Chavanel’s team mate, was chased down by some of the teams in the peloton after 100km during Friday’s stage.
Chavanel attacked shortly after Duque was reeled and he was allowed to go out on his own.
“I attacked and for a while I was racing at 65 kmh just to increase the gap,” Chavanel, who in recent weeks has been caught several times by the peloton while close to the finish line, said.
“It is the first time I have managed to take one of my breakaways on this race all the way. It just shows, if you keep at it you can succeed.”
Spaniard Oscar Freire, meanwhile, took an almost unassailable lead in the points competition, whose prize is the green jersey.
He now has 244 points, a lead of 42 points over Milram’s veteran sprinter Erik Zabel on 202. Norwegian Thor Hushovd lies third on 198.