Paul Pogba put France ahead in the 79th minute, heading in at the far post after Nigeria goalkeeper Vincent Enyeama flapped at Mathieu Valbuena’s corner following a sustained spell of French pressure.
The win was sealed when Joseph Yobo turned a low cross into his own goal in stoppage time and France will play Germany or Algeria in the last eight.
It was a controversial victory, however, as the game had swung France’s way after Nigeria’s influential midfielder Ogenyi Onazi was injured by a late tackle from Blaise Matuidi, who was lucky to escape with only a yellow card.
Nigeria had been defending increasingly desperately in the run-up to Pogba’s goal.
France were centimetres from going ahead when Karim Benzema poked the ball past Enyeama, who managed to partly block his shot and Victor Moses hooked the ball off the line.
Nigeria escaped again when John Obi Mikel cleared Benzema’s shot off the line, then Yohan Cabaye struck the underside of the crossbar with a thunderous long-range strike. Enyeama then tipped Benzema’s close-range header over the bar, leading to the corner from which France scored their first goal.
The first half had been much more even.
Nigeria made a bright start and thought they had gone ahead when Emmanuel Emenike turned in Ahmed Musa’s low cross at the near post but the effort was ruled offside in an extremely close call.