A Paul Pogba header and a Joseph Yobo own goal saw France edge a hard-fought contest with Nigeria 2-0 in Brasilia on Monday to reach the World Cup quarter-finals.
Pogba broke the deadlock in the 79th minute, nodding into an empty net after Nigeria goalkeeper Vincent Enyeama, who plays for French club Lille, failed to collect a corner.
It was a cruel moment for Enyeama, but rewarded a barrage of French pressure sparked by the introduction of Antoine Griezmann, who forced Yobo to put through his own goal in injury time.
Didier Deschamps's France will now play Germany at the Maracana in Rio de Janeiro on July 4.
African champions Nigeria, meanwhile, must wait to sample the last eight at a World Cup, following defeat in their first knockout-phase match at the tournament since the 1998 competition in France.
Stephen Keshi's side nonetheless departed to the sound of warm applause from the fans crammed into the cavernous Mane Garrincha National Stadium, who allied themselves with Nigeria's cause from the off.
While France, who showed six changes, started purposefully, their final ball frequently let them down, which handed Nigeria opportunities to use their pace on the counter-attack.
Emmanuel Emenike thought he had put Nigeria ahead in the 19th minute when he deftly prodded in an in-swinging cross from Ahmed Musa, but the offside flag allowed French heart rates to return to normal.
France looked more threatening when they were able to bring the recalled Mathieu Valbuena into the game.
When the Marseille midfielder teed up Pogba for a vicious volley mid-way through the first half, it took a stunning reflex save from Enyeama to keep the game scoreless.
Onazi stretchered off
Another intelligent pass from Valbuena then gave Mathieu Debuchy a sight of goal, but the Newcastle United right-back drilled wide.
Late in the first half Emenike took aim from range, but Hugo Lloris was able to parry.
Nigeria suffered a blow early in the second period when Lazio midfielder Ogenyi Onazi had to be stretchered off after an ugly, ankle-high challenge by Blaise Matuidi, who escaped with only a caution.
Faced with growing Nigeria pressure, Deschamps introduced Griezmann in place of Olivier Giroud with half an hour to play and the move quickly paid immediate dividends.
After Lloris had saved from Peter Odemwingie, a one-two between Karim Benzema and Griezmann set the Real Madrid man clear, but although he squeezed the ball past Enyeama, Victor Moses was on hand to hook clear.
It was to prove a temporary reprieve.
Yohan Cabaye, back from suspension, saw a 20-yard half-volley crash back off the bar before Enyeama had to produce a finger-tip save to touch a Benzema header over the bar.
It was the second fine stop of the match from the 31-year-old, but secondslater his failure to claim Valbuena's left-wing corner allowed Juventus midfielder Pogba to head in at the back post.
Enyeama then palmed a shot from Griezmann over the bar, but France made it 2-0 at the death when Yobo, under pressure from Griezmann, inadvertentlysteered Valbuena's drilled cross into his own net.