France scored twice in the final 11 minutes in Brasilia to beat Nigeria and reach the World Cup quarter-finals.
Nigeria’s Emmanuel Emenike had a strike ruled out for offside before Vincent Enyeama saved Paul Pogba’s volley.
Victor Moses cleared Karim Benzema’s shot off the line after the break and Yohan Cabaye volleyed against the bar as France pressed.
But Pogba eventually headed in after an Enyeama error and Joseph Yobo diverted Mathieu Valbuena’s cross into the net.
France will play Germany, who beat Algeria 2-1 after extra time, in the last eight at the Maracana on Friday.
The final scoreline was harsh on Nigeria, who dominated for large parts of the second half, but late mistakes from their tiring players ensured they will have to wait for their first quarter-final appearance in a World Cup.
France have pedigree in the knockout rounds, having reached at least the semi-finals on the last five occasions they have progressed past the first round at the World Cup.
Nigeria’s last-16 preparations had been disrupted by a row over bonuses and, with their group victory over Bosnia-Hercegovina their only World Cup win in 11 matches, this tie was always going to prove a big ask.
But, attacking with pace down the wings through both Moses and Ahmed Musa, the Super Eagles looked threatening early on. Only a flag for offside denied the powerful Emenike the opener, when he tapped home Musa’s cross.
Nigeria keeper Enyeama made the most saves in the group phase and had to be alert again to keep out Pogba’s fierce close-range volley as the play swept from end to end in a first half that saw both sides look vulnerable defensively.
Juventus’s Pogba was being afforded a lot of space but, as was the case all over the pitch, the final ball was all too often wasteful, with Mat
hieu Debuchy’s off-target shot the only other notable attempt in a half that promised more than it delivered.
The African champions were forced into a change after the break when influential midfielder Ogenyi Onazi was injured by a late tackle from Blaise Matuidi, who was lucky to escape with only a yellow card.
France, the 2006 runners-up, did not make it past the group stage in South Africa four years ago but they appear to be much more united as a squad in this tournament.
That togetherness was needed as Nigeria controlled the opening stages of the second half and only a sharp stop from Hugo Lloris prevented Peter Odemwingie’s low shot from giving the Africans the lead.
Against the run of play Benzema almost gave France the lead. The Real Madrid man played a neat one-two with Antoine Griezmann before seeing his shot partially blocked by Enyeama and then hacked off the line by Moses.
The introduction of Griezmann for Olivier Giroud saw France emerge more as an attacking force, with Benzema playing more centrally, and the breakthrough came when Pogba headed into an empty net after Enyeama had misjudged Valbuena’s corner.
And, as Nigeria pushed for a leveller, Joseph Yobo flicked Valbuena’s low cross into his own net on the day he surpassed Jay-Jay Okocha’s record of nine World Cup matches for the Super Eagles.