Holders Nigeria waved goodbye to the U23 African Cup of Nations after failing to break down South Africa in a 0-0 draw on Friday, with the Bafana Bafana setting up a semi-final meeting with hosts Egypt.
Cote d'Ivoire finished on top of the group with six points after beating Zambia (bottom with one point) 1-0, thanks to a looping header from Kouadio Dabila just after the hour mark. South Africa are second on five points, followed by Nigeria on four.
The Elephants' victory meant Nigeria had to overcome South Africa to go through but the Super Eagles struggled to carve out openings in a dull affair.
However, Nigeria still spurned a golden chance to snatch a win at the death when substitute Sunday Faleye was found unmarked at the far post deep in stoppage time, only to send a poor free header wide of the post.
Egypt, who topped Group A with maximum nine points, will face South Africa in the semi-final at Cairo Stadium on Tuesday, with Cote d'Ivoire meeting Ghana in the other last-four encounter later on the same day.
The winners of the semi-final ties will ensure their progress to next year's Olympic Games while the losers will face off in a decisive third-place playoff, which will determine Africa's last representative at the Tokyo Games.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)