Morocco had to leave it late to defeat South Africa in their final Group D encounter at the Al Salam Stadium.
A 90th-minute strike from Moubarak Boussoufa for the Atlas Lions broke the heart of the Bafana Bafana after a fiercely contested game.
Morocco nearly broke the deadlock in the 64th through Achraf Hakimi whose fierce strike came off the crossbar. Minutes later Youssef En-Nasri latched onto a pass inside the box and rounded goalkeeper Ronwen Williams but failed to hit the target.
Â
Meanwhile, the other Group D fixture which was played at the June 30 Stadium saw Ivory Coast beat Namibia 4-1.Â
Goals from Max Gradel, Serey Die, Wilfred Zaha and Maxwell Cornet ensured the Elephants booked a slot in the round of 16.
Morocco topped the Group D with 7 points and Ivory Coast qualified to round 16 with seven and six points respectively while South Africa who are on three points will hoping to qualify as one of the third best-placed teams should other results go in their favour.
READ ALSO:
AFCON 2019: Egypt see off Uganda to top Group A, DR Congo thump Zimbabwe