Hosts Egypt crashed out of 2019 AFCON after a late Thembinkosi Lorch goal gave South Africa a 1-0 win in Cairo in a Round of 16 clash.
The 1996 champions will now meet three-times champions Nigeria on Wednesday in the quarter-finals.
The Pharaohs were left stunned as Thembinkosi Lorch’s late strike silenced the home fans giving South Africa a 1-0 victory.
Having barely scraped through the group stage as one of the best losers, virtually no one gave Bafana Bafana a chance against Mohamed Salah and teammates.
However, late into the game played in front over 50,000 Egyptian fans, South Africa did the unexpected as a well-worked move saw Lebo Mothiba stride into space and square the ball for Lorch, who kept his composure to side-foot past El-Shenawy and send his side into the last eight.
South Africa will face Nigeria in last eight after the Super Eagles earlier saw off Cameroon 3-2 in a five-goal thriller.