Former African Footballer of the Year Victor Osimhen was instrumental in his team establish a 3-0 advantage, but the Super Eagles were compelled to defend resolutely for a hard-fought win.
Nigeria survived a stunning late rally from Tunisia to advance to the last 16 of the 2025 Africa Cup of Nations taking place in the host nation.
Jose Peseiro's side appeared to be cruising in their Group C encounter in the Moroccan city, enjoying a three-goal lead with only 17 minutes remaining courtesy of goals from their attacking trio.
Yet, Montassar Talbi reduced the deficit with a close-range finish from a Hannibal Mejbri set-piece, igniting hopes of a turnaround.
The drama intensified when Tunisia were given a spot-kick after a VAR check identified a handling offense by Bright Osayi-Samuel. Ali Abdi converted in the 87th minute to set up a frantic conclusion.
The Carthage Eagles were inches away from a stunning leveler in added time, with their skipper directing a chance narrowly wide before Ismael Gharbi sent a bobbling volley past the goal frame.
Securing First Place
The victory means that the Super Eagles, champions of the competition on three past instances, advance to 6 group points and are assured first place in their pool with a match left to play.
In the next round, they will face a best third-place side from one of the other preliminary groups.
Meanwhile, Tunisia stay on 3 points, with the East African teams tied on a single point after registering a one-all draw in the day's other fixture.
The concluding pool fixtures will see Nigeria remain in the city to take on the Cranes on Tuesday, while Tunisia travel back to the capital to confront the Taifa Stars.
A Nervy Conclusion
Ali Abdi smashed the ball from 12 yards to offer Tunisia a glimmer of hope of earning a point.
Nigeria, finalists in the 2023 edition, become the next team after the Pharaohs to qualify for the next phase, but their manager and supporters will certainly be feeling relieved.
What looked like set to be a straightforward final quarter transformed into a tense affair.
Victor Osimhen had a effort ruled out for an infringement before opening the scoring right before the interval, expertly guiding a header into the far post from an Ademola Lookman delivery.
The lead was extended early in the second period when the Leicester City midfielder rose highest to power home a header from a set-piece corner.
Osimhen then turned provider Lookman for the third goal, before Montassar Talbi to steer a powerful header past the Nigerian shot-stopper to begin the comeback.
The key incident arrived when a high ball hit the arm of the full-back, with the official awarding a penalty after reviewing the VAR monitor.
Despite the defender's successful penalty, Tunisia in the end fell short of completing a stirring comeback.
Tunisia's destiny remains in their control; a point against Tunisia will be enough to see them through, and manager Sami Trabelsi will be eager to avoid a repeat of the 2013 group-stage exit that led to his previous resignation.