Gallopin, who wore the yellow jersey for a day before Nibali recaptured it, first tried to break away with about 8.4 miles left but got reeled in. Then, in a late flurry, with less than 3 kilometers to go, the Lotto-Belisol rider tried again. This time, it worked.
He chiseled out a lead of several seconds and, desperately pedaling, held off a surging pack in the final several hundred meters.
Gallopin won by several bike lengths, just enough for him to have time to lift his arms in celebration, panting.
"Incredible," said Gallopin of his first Tour stage win. "I came to train for the Tour de France here ... that really served me today."
The top standings didn't change, because Nibali finished in the pack with the same time as Gallopin. Astana team leader Nibali has a lead of 2 minutes, 23 seconds over Australia's Richie Porte, in second. Alejandro Valverde of Spain was third, another 24 seconds back. Gallopin was in fifth, 3:12 behind Nibali.
With such a margin and the strong form he has shown so far, Nibali is looking well-positioned for possible victory when the race ends in Paris on July 27. But tough days lie ahead: in the Alps later this week, and the Pyrenees mountains in Week Three.
Talansky, in pain after two crashes twice in recent days, dropped back from the peloton more than halfway through the stage. At one point, he stopped and sat down on a roadside guard rail. French TV first counted him out, as did some observers on Twitter.
But in a show of heart, and with encouragement from his team sports director Robert Hunter, Talansky got back on his bike, wiped his eyes and continued.
Stage 12 preview
P Thursday, 6 a.m.
TV • NBCSN
Frenchman Tony Gallopin had a good day, winning his first career stage on the showcase race with a sprint finish at the end of a long and hot day in the saddle, and Italian Vincenzo Nibali comfortably retained the overall lead.Thursday's 12th stage is an undulating 115-mile route from Bourg-en-Bresse to Saint-Etienne in south-eastern France.
1. Vincenzo Nibali • Italy, Astana, 46 hours, 59 minutes, 23 seconds
2. Richie Porte • Australia, Sky, 2:23
3. Alejandro Valverde • Spain, Movistar, 2:47.
7. Tejay van Garderen • United States, BMC Racing, 3:56.