In Ismailia, Ghana needed an extra-time strike from Dominic Adiyiah to edge their opponents 2-1 in an all-African affair.
Talisman Andre Ayew scored his second goal of the competition to cancel out Kermit Erasmus' opener for South Africa.
The Black Satellites will now face South Korea in Suez on Friday after the Asians cruised past Paraguay on Monday.
Gulasci Show
In Port-Said, Hungary goalkeeper Peter Gulasci was the hero as he saved three penalty kicks to send the outsiders through to the last eight.
Gulasci denied Lukas Marecek, Jan Moravek and Radim Reznik to help Hungary win the shootout 4-3, following a 2-2 full-time scoreline.
Mate Kiss gave Hungary a 15th minute lead, but Jan Vosahlik equalized after 11 minutes to force extra time, where Michael Rabusic's goal for the Czech was canceled out by Vladimir Koman.
Hungary will meet Italy, who beat Spain 3-1, in Suez on Friday.