They were 91 for 7 at one stage in their chase of 139 against Sierra Leone Under-19s, but Peter Aho did the trick for Nigeria Under-19s to give them a two-wicket win and a place at the Under-19 World Cup - or any global cricket tournament - for the first time.
The result gave Nigeria an all-win record in the Under-19 World Cup Qualifier Africa Division One competition, played in Windhoek, with hosts Namibia ending second, followed by Uganda, Sierra Leone, Kenya and Tanzania.
Namibia took on Kenya in one of the other matches on the day, and won by 198 runs - they scored 194 for 5 and bowled the opponents out for 96 - to boost their net run-rate in a big way, and a loss for Nigeria would have put the home side in the World Cup.
That looked like the case when, in response to Sierra Leone's 138, Nigeria slipped to 33 for 3, and then lost their seventh wicket with just 91 on the board. But Aho, who had earlier returned 2 for 49, did it with the bat too, walking in at No. 8 and scoring an unbeaten 21 from 32 balls to take Nigeria past the target with 34 balls in hand.
Earlier in the game, after George Ngegba won the toss and opted to bat, Sierra Leone rode on Haroun Kamara's 58 in 60 balls from No. 5 to stay in the fight. John Bangura chipped in with 21 and Osman Sankoh 24 as they put up what looked like a low total but turned out to be very competitive.
Nigeria struggled in response, even though many of their batsmen got good starts.
Olayinka Olaleye scored 16 at the top, Isaac Danladi 25, and Miracle Ikaige 22, but with Sankoh leading the show with the ball for Sierra Leone with 3 for 13 from his ten overs, the wickets kept falling. It needed Aho's nerveless innings, in which he hit three fours, towards the end to complete the job for Nigeria.
Sylvester Okpe, the Nigeria captain, admitted to being "a bit scared" when the chase seemed to have gone off track, but told the ICC, "Today wasn't supposed to be tough, but the openers [Sierra Leone bowlers Sankoh and Ngegba, who got 2 for 24] made it tough and we almost lost our heads but at the end, we came out strong."