The Spaniard, a winner on the Tour in 2008, 2009 and 2011, surged ahead 11km from the line to win a stage marred by several punctures, apparently caused by nails and tacks thrown on the road.
Sanchez crossed the line 47 seconds ahead of Peter Sagan, who strengthened his lead in the points classification, while Frenchman Sandy Casar was third in the same time as the Slovakian.
Defending champion Cadel Evans had to stop three times on the descent of the first-category Mur de Peguere, 38.5km from the finish, because of the nails and tacks on the tarmac.
The Australian's first flat tyre came at the top of the climb and he had to wait several minutes for a teammate to assist him as his team car was already speeding down the descent and could not turn back.
The peloton, informed about the incident by the race radio, slowed down to wait for Evans's return into the pack and as a result the overall standings did not change.
Briton Bradley Wiggins still leads compatriot Chris Froome by two minutes five seconds while Italy's Vincenzo Nibali lies third, 2:23 adrift.
Evans is still 3:19 off the pace in fourth place.