Nigeria qualified for the next round of the Africa Cup of Nations after two late Victor Moses penalties gave them a crucial win against Ethiopia.
Moses, 22, opened the scoring from the spot after he was fouled by defender Alula Girma with 10 minutes to go.
The winger earned the second penalty when he was brought down by goalkeeper Sisay Bancha, who was sent off.
If Nigeria had gone out of the Africa Cup of Nations, it would have been the first time since 1982 they had not made the quarter-finals
If Moses had not scored they would have lost a quarter-final spot to Zambia due to a worse disciplinary record.
Holders Zambia and Nigeria had come into their last round of group fixtures level on points and with an equal goal difference after they drew both their opening games 1-1.
Before Moses’s intervention, his side had been set for an early trip home as they had collected more yellow cards. But instead it was Zambia who were eliminated after they could only manage a goalless stalemate against eventual group winners Burkina Faso.
Aware of the potential for that scenario, the Super Eagles began in Rustenberg with an intent absent in the tournament so far.
Defender Efe Ambrose – recalled to the team after missing out against Zambia through suspension – headed a Moses free-kick over the crossbar when well positioned, before Bancha was alert to stop Ikechukwu Uche reaching an incisive John Obi Mikel through-ball.
Some more sharp play from Nigeria saw another chance go to waste when a selfless cut-back from Uche was blazed well over by rampaging left-back Elderson Echiejile.
While struggling to retain possession in their usual manner, Ethiopia did sporadically threaten with their set-piece delivery.
Nigeria head coach Stephen Keshi had decided not to select fit-again captain Joseph Yobo, and in the 32-year-old’s absence, the Super Eagles struggled to convincingly deal with high balls played into their penalty area.
Saladin Seid headed one Ethiopia corner over, while a number of other crosses caused panic at the back for Nigeria.
Dead balls were also causing a problem at the other end of the pitch, and Echiejile stung Bancha’s fingertips with a powerful header from a deep Moses corner.
Nigeria’s suspect defending had already seen them surrender late leads against Burkina Faso and Zambia, and a comical misunderstanding between retreating winger Sunday Mba and right-back Ambrose played in Ethiopia danger man Seid but his shot was deflected harmlessly into goalkeeper Vincent Enyeama’s hands.