South Africa are staring at an Africa Cup of Nations exit following a late 1-0 loss to Morocco in their final Group D game on Monday.
Bafana Bafana needed a win to guarantee their place in the last 16 but were beaten thanks to Moubarak Boussoufa's strike, allowing Ivory Coast to progress in second place in their stead thanks to a 4-1 defeat of Namibia.
Morocco were already sure of a place in the next round and always looked the more likely to find a breakthrough, with Achraf Hakimi rattling the crossbar in the second half before Boussoufa's 90th-minute goal.