Geniez took the win on stage 15 after over 5,000 metres of climbing and more than six hours of riding, having attacked from a lead group of 28 riders with around 20 kilometres to go.
The FDJ rider crossed the line for his maiden Grand Tour win three minutes and three seconds ahead of Italy's Michele Scarponi, with Ireland's Nicolas Roche third.
"Having a finish in France was extra motivation but this was a very tough day to try to go for the win," Geniez told reporters.
"There were nearly 30 of us in the break early on, which is a lot, and it was hard to work out who was going to work the hardest to make sure it stayed clear.
"When we got to the last two climbs, though, gradually people lost time and I was able to get clear."
Spain's Joaquim Rodriguez, fourth overall, made several attacks on the final ascent but was unable to shake off Nibali, who finished fourth on the stage.
"It was a very tough day, very similar to yesterday's stage although the weather was a little better and it seemed like the whole bunch wanted to be in the early break," Nibali said.
"Rodriguez pushed as hard as he could on that last climb and I and my team had to work hard to keep everything under control."
Asked if tomorrow's final Pyrenean stage, with a summit finish at Sallent de Gallego, would be equally difficult, Nibali said: "It's not the terrain that begins to affect you at this point in the race, it's the tiredness."
Philippe Gilbert of Belgium and German Tony Martin, the world road-race and time trial champions respectively, both pulled out of the race during the stage. The world championships take place in Italy from Sept. 23-29. The Vuelta finishes on Sept. 15 in Madrid.
Stage 15 Result
1. Alexandre Geniez (France / FDJ.fr) 6:20:12"
2. Michele Scarponi (Italy / Lampre) +3:02"
3. Nicolas Roche (Ireland / Saxo - Tinkoff) +3:07"
4. Vincenzo Nibali (Italy / Astana) +3:20"
5. Alejandro Valverde (Spain / Movistar)
6. Chris Horner (U.S. / RadioShack)
7. Joaquim Rodriguez (Spain / Katusha)
8. Domenico Pozzovivo (Italy / AG2R)
9. Jose Herrada (Spain / Movistar) +3:23"
10. David Arroyo (Spain / Caja Rural)
1. Vincenzo Nibali (Italy / Astana) 60:20:21"
2. Chris Horner (U.S. / RadioShack) +50"
3. Alejandro Valverde (Spain / Movistar) +1:42"
4. Joaquim Rodriguez (Spain / Katusha) +2:57"
5. Domenico Pozzovivo (Italy / AG2R) +3:43"
6. Nicolas Roche (Ireland / Saxo - Tinkoff) +3:49
7. Thibaut Pinot (France / FDJ.fr) +4:59"
8. Leopold Koenig (Czech Republic / NetApp) +6:18"
9. Samuel Sanchez (Spain / Euskaltel) +7:46"
10. Tanel Kangert (Estonia / Astana) +9:11"