Two stunning goals, from May Mahlangu and Siyabonga Sangweni, saw Bafana Bafana twice fight back from a goal down to draw against Morocco in a drama-filled cracker of a game at Moses Mabhida Stadium, and send the host nation to the quarterfinals of the Africa Nations Cup.
It was a tense affair as the other game in Group A was also a see-saw affair as Angola went 1-0 ahead, before Cape Verde equalised and eventually won.
The two results mean Bafana top the group on a better goal difference than Cape Verde who also finished on five points and Morocco crash out spectacularly.
Just before kick-off there was some rain that fell on the Moses Mabida pitch, making the surface a lot greasier than when Bafana Bafana played Angola at the same venue a few days earlier.
Two minutes into the game Morocco's Youssef Kaddioui had a strike from range when the ball spun out to him following a corner kick. But his shot went wide of goal.
Then, in the fourth minute Khune made a fantastic save on the edge of his area as he sped forward to close down Youssef Al Arabi before he could get a clear shot on goal.
Dean Furman made a great tackle inside his own penalty area in the 8th minute as he slid in to stop a square ball finding one of the Moroccan strikers.
But from the resultant corner kick Morocco scored. The corner was swung in and Issam El Adoua rose highest to head in under the crossbar as Khune was caught in no man's land, having come out but not made contact with the ball.
In the 36th minute Tokelo Rantie showed incredible pace to burst through on the counter attack, but was tackled and Bafana won a corner. They could not make the most of it, but the signs were showing that the home side were more settled on the ball.
In the 45th minute Bafana were caught on the counter attack and Chafni beat the offside trap to run through one on one with Khune. But the keeper had come out a long way and made a fantastic tackle to avert the danger.
Thulani Serero was brought on as an early substitution, replacing Mphela in the 51st minute.
Two minutes later Phala let rip with a curling free kick, which was going top corner, but the Moroccan goalkeeper, Nadir Lamyaghri made a top draw save.