The Eagles had to come from behind before securing a 2-1 win over Angola on Sunday night in Tangiers.
After a barren first half in which both sides missed glorious chances, the Angola team went in front in the 55th minute.
It was looking like the end of the road for the Nigerian team until Anthony Okpotu popped up with a very late equalizer in the 91st minute.
With the game stretching into extra time, one of the new entrants, Gabriel Okechukwu, saved the day for Nigeria with a well-taken goal.
Despite fierce attempts by Angola to force the game to penalties, the coach Salisu Yusuf-tutored side held on as they became the third team to qualify for the semi-final where they will face Sudan.