The defending Tour de France champion Alberto Contador showed his fighting spirit when he gained 10 seconds over Andy Schleck, the Spaniard finishing second in the 12th stage, a 210.5-km ride from Bourg de Peage, after he was outsprinted by compatriot Joaquim Rodriguez.
Contador's lieutenant at Astana, Kazakh Alexandre Vinokourov, was third, four seconds behind.
Twice Tour champion Contador attacked in the final climb, a 3.1-km section at an average gradient of 10.1 per cent, and Schleck, who retained the yellow jersey, could not respond.
The Luxembourg rider was fifth in the stage, 10 seconds behind, and now holds a 31-second advantage over Contador two days before the Tour enters the Pyrenees.
American rider Tyler Farrar pulled out of the Tour de France during Friday's 12th stage, succumbing to a broken wrist sustained in a crash on the second stage to Spa in Belgium.
The sprint specialist and team-mate of New Zealander Julian Dean was looking to give their Garmin Transitions team a first Tour stage win.
Dean finished 144th on the day's stage and he's 159th overall.