Former African Footballer of the Year Victor Osimhen was instrumental in his team establish a commanding lead, before the Super Eagles were forced to hold on for a hard-fought win.
Nigeria survived a stunning late rally from Tunisia to advance to the knockout stage of the 2025 Africa Cup of Nations taking place in Morocco.
Jose Peseiro's side seemed to be cruising in their pool clash in the Moroccan city, holding a 3-0 lead with just 17 minutes left thanks to goals from Victor Osimhen, Wilfred Ndidi and Ademola Lookman.
However, a Tunisian defender pulled one back with a close-range finish from a Manchester United midfielder set-piece, sparking hopes of a turnaround.
The drama escalated when the North Africans were awarded a late penalty after a video assistant referee check spotted a handball by the Nigerian defender. Ali Abdi calmly slotted home in the 87th minute to create a nail-biting finale.
The Carthage Eagles were inches away from a last-gasp leveler in added time, with captain Ferjani Sassi directing a opportunity narrowly wide before a substitute sent a bobbling volley past the upright.
Securing Top Spot
The victory ensures that the Super Eagles, champions of the competition on 3 past instances, move to 6 points and are assured first place in Group C with one game still to be contested.
For the round of 16, they will meet a best third-place side from one of Group A, B or F.
In the other match, Tunisia remain on 3 points, with Uganda and Tanzania tied on a single point each after playing out a one-all draw in the day's other fixture.
The concluding pool fixtures will see the group leaders remain in the city to take on Uganda on the next matchday, while Tunisia travel back to the capital to face the Taifa Stars.
An Anxious Conclusion
The Tunisian defender smashed home from the penalty spot to offer Tunisia a glimmer of hope of snatching a draw.
Nigeria, runners-up in the 2023 edition, become the next nation after the Pharaohs to qualify for the knockout stage, but their manager and fans will undoubtedly be breathing a sigh of relief.
What looked like set to be a straightforward last period morphed into a nerve-wracking conclusion.
The prolific striker had a effort ruled out for an infringement before opening the scoring on the stroke of the interval, expertly guiding a glancing effort into the bottom corner from an Ademola Lookman cross.
The advantage was doubled early in the second half when Wilfred Ndidi climbed above everyone to thump in a header from a set-piece corner.
Osimhen then set up his teammate for the third goal, before Montassar Talbi to steer a powerful header past the Nigerian shot-stopper to initiate the fightback.
The key moment arrived when a looping cross struck the forearm of Bright Osayi-Samuel, with the official pointing to the spot after consulting the VAR monitor.
Despite the defender's confident conversion, Tunisia ultimately came up just short of pulling off a stirring recovery.
Their fate is still in their own hands; a draw against Tunisia will be enough to secure progression, and their coach will be keen to avoid a repeat of the 2013 group-stage exit that led to his departure.