Ghana's Dede Ayew (left) and South Africa's Kermit Erasmus both scored
Ghana needed extra-time and a special goal from Dominic Adiyiah to beat South Africa and go through to the quarter-finals of the Under-20 World Cup.
It was 1-1 after 90 minutes thanks to goals from South Africa's Kermit Erasmus and Ghana's Dede Ayew.
The game went into extra-time and Dominic Adiya produced a spectacular shot to win the day for Ghana.
They now face South Korea in the quarter-finals on Friday.
In the first half, although neither team dominated, it was South Africa who had the better chances.
They forced Ghana's Daniel Agyei into a number of impressive saves - and Thulani Hlatshwayo had a free header which he should have got on target.
Ghana were far from the free-flowing, easy looking team which had sailed through the group stages - in contrast, Amajita had carried their good form against Honduras into this game.
12 minutes into the second half, Kermit Erasmus scored to give South Africa a 1-0 lead - pouncing on a loose clearance to shoot home powerfully.
Ghana at last seemed to have some energy about them, and on 65 minutes they were level - a swinging free-kicking meeting the head of Dede Ayew, who placed in perfectly to make the score 1-1.
Ghana were finally creating more chances but they were too careless in possession and frequently gave the ball away, but South Africa could not capitalize and the 90 minutes finished with the teams level.
In extra-time it seemed the game would need something special to break the deadlock and with 9 minutes of the first period on the clock, Ghana's Adiyiah produced it.
His powerful swirling shot rocketed into the top corner to give the Black Satellites a 2-1 lead.
In the second period of extra-time, Ghana's task was made tougher when substitute Opoku Agyemang was sent off for a second yellow card, after being judged to have dived in the area.
But they held on and go through to meet South Korea in the next round - South Africa must go home.
Ghana will now play South Korea in the quarter-finals on 9 October, after they beat Paraguay in the last 16 on Monday.
Bookmark with:
What are these?