South Africa kept alive their hopes of reaching the last 16 by beating neighbours Namibia 1-0 in the Africa Cup of Nations Group D.
Bongani Zungu headed past Lloyd Kazapua from a second-half corner to score his country’s first goal of the tournament.
Moments earlier, Deon Kavendji’s close range effort was cleared off the line for Namibia in Cairo.
To qualify, Bafana Bafana need a better result against group leaders Morocco than Ivory Coast get against Namibia.
They had the better chances of a disappointing first half, although Themba Zwane could only fire their best effort straight at goalkeeper Lloyd Kazapua.
Namibia moved the ball with greater urgency and Kavendji’s pace was a threat down the left but his final ball was often wayward.
Stuart Baxter’s side improved after the break as the impressive Zwane moved over to the left, and the break-through came from a set-piece as Zungu beat his marker to head in the winner.
Namibia still have an outside chance of qualification themselves, but they will need to score their first tournament goal since 2008 to beat Ivory Coast, and hope Morocco beat South Africa by more than one goal.