Holders Cameroon were knocked out of the Africa Cup of Nations by Nigeria in a five-goal last-16 thriller.
Goals from Stephane Bahoken and Clinton Njie saw Cameroon lead 2-1 at half-time after Odion Ighalo had put Nigeria ahead in Alexandria, Egypt.
But two goals in three minutes swung the game back in Nigeria’s favour and set up a quarter-final with either hosts Egypt or South Africa.
Ighalo equalised before the forward set up Alex Iwobi to hit the winner.
Nigeria had been on the receiving end of an upset in their previous game, a 2-0 defeat by Madagascar in their final group match.
Yet they produced their best performance of the tournament to end Cameroon’s hopes of retaining the title they won in Gabon in 2017.
Ighalo’s deflected shot gave Nigeria the lead before Bahoken side-footed the equaliser after Christian Bassogog’s cross.
In an enthralling tie, Cameroon took the lead through Njie’s composed finish.
Man-of-the-match Ighalo made it 2-2 with a volley after Ahmed Musa’s chest down before Ighalo turned provider for Arsenal’s Iwobi to slot in a dramatic decisive goal.
BBC Sport’s Nick Cavell in Alexandria
For once, this was a big-name match-up that lived up to the billing, especially in terms of the goals scored and the ebb and flow of the match.
This was the best either side has played so far at the tournament and it still felt as if there was a lack of real quality from both teams. That was reflected in the first goals scored – Nigeria’s was a deflected effort and Cameroon’s quickfire strikes were both a result of defensive errors.
The second period was better and Nigeria looked hungrier. They also played better and their two goals both involved a lot more skill than luck.
Ighalo looked like he did in his best days at Watford, Iwobi showed the quality that Arsenal fans are crying out for and Leicester City fans may well be asking if this was the same Ahmed Musa that played for them.
For Cameroon, Andre Onana pulled off a few saves to show why he is currently the most-highly rated African keeper around, as he continued to show his form of the past season with Ajax.
Pierre Kunde did his best with his set-pieces but the quality was not there to make the most of them.