Ex- African Footballer of the Year Victor Osimhen was instrumental in Nigeria build a 3-0 advantage, but they were forced to defend resolutely for a hard-fought win.
Nigeria survived a dramatic late rally from Tunisia to progress to the last 16 of the Afcon tournament taking place in Morocco.
The Super Eagles appeared to be cruising in their Group C encounter in the Moroccan city, holding a three-goal cushion with only a quarter of an hour left thanks to goals from their attacking trio.
Yet, a Tunisian defender reduced the deficit with a powerful header from a Hannibal Mejbri free-kick, sparking hopes of a turnaround.
The tension intensified when Tunisia were given a spot-kick after a video assistant referee check identified a handball by Bright Osayi-Samuel. Ali Abdi calmly slotted home in the dying stages to set up a nail-biting conclusion.
Tunisia came agonizingly close from a last-gasp equalizer in added time, with captain Ferjani Sassi heading a chance narrowly wide before Ismael Gharbi sent a half-volley wide of the upright.
This result means that Nigeria, champions of the tournament on 3 previous occasions, move to six points and are guaranteed top spot in Group C with a match left to be contested.
For the round of 16, they will meet a third-placed side from either Group A, B or F.
In the other match, Tunisia remain on three group points, with the East African teams locked on one point each after registering a 1-1 stalemate in the day's other fixture.
The final group fixtures will see the group leaders remain in Fes to play the Cranes on the next matchday, while the Eagles of Carthage return to the capital to confront Tanzania.
Ali Abdi smashed home from the penalty spot to offer his team hope of earning a point.
Nigeria, runners-up in the previous tournament, become the next nation after Egypt to reach the next phase, but coach Eric Chelle and supporters will undoubtedly be breathing a sigh of relief.
What seemed set to be a straightforward last period transformed into a tense affair.
Victor Osimhen had a effort disallowed for an infringement before opening the scoring on the stroke of half-time, precisely placing a glancing effort into the bottom corner from an Ademola Lookman cross.
The advantage was doubled soon in the second period when Wilfred Ndidi climbed above everyone to thump in a powerful nod from a set-piece corner.
The number 9 then turned provider his teammate for the third goal, before the defender to steer a powerful header past goalkeeper Stanley Nwabali to initiate the comeback.
The pivotal incident arrived when a looping cross struck the forearm of the full-back, with the official pointing to the spot after consulting the pitchside screen.
Although the defender's successful penalty, Tunisia ultimately came up just short of pulling off a remarkable recovery.
Tunisia's destiny remains in their control; a point against Tunisia will be sufficient to see them through, and their coach will be eager to prevent a repeat of the past early elimination that resulted in his previous resignation.
A tech enthusiast and journalist with over a decade of experience covering emerging technologies and digital transformations.
Michael Hunter
Michael Hunter
Michael Hunter
Michael Hunter
Michael Hunter
Michael Hunter