Morocco have been held to a 2-2 draw against South Africa, confirming their exit from the Africa Cup of Nations.
Eric Gerets's men went ahead in the 10th minute though Issam El Adoua, who headed home from Abdelaziz Barrada's corner.
Another dangerous corner gave Chahir Belghazouani the chance to double that lead, but Itumeleng Khune was alert to touch his effort around the post.
South Africa eventually settled into the contest but they still went in trailing at the break.
Morocco picked up the baton once again in the second half and looked like extending their lead, only to be pegged back thanks to a wonderful strike by May Mahlangu.
He cut inside his marker before curling a shot past into a net.
Morocco were now staring down the barrel of elimination, but they were handed a lifeline when Abdelilah Elhafidi restored their lead with eight minutes remaining.
South Africa were not behind for long though, as Siyabonga Sangweni clipped a right-footed shot past a despairing Nadir Lamyaghri just four minutes later.