Amaglug-Glug lost 1-0 to hosts Japan and 4-3 to France in a match in which they held the lead on three occasions before going down 3-0 to Mexico in Sapporo.
As a result, South Africa finished bottom of Group A and will depart Tokyo as one of two teams having failed to conjure a single point from their allotted matches.
Egypt will face Brazil in the knockout stages following a 2-0 win over Australia in Group C. Victory moved the North Africans up to second – above Argentina on goal difference – and behind Spain who advanced as group winners.
Ivory Coast also qualified for the knockout stages as group runners-up. The West African nation drew 1-1 with Germany in Group D to finish ahead of the Europeans and behind defending gold-medal winners, Brazil.
Egypt and Ivory Coast will be aiming to become the third African nation to win gold at the Olympic Games following Nigeria (1996) and Cameroon (2000).
Ghana won bronze at the 1992 Games while Egypt have finished fourth on two occasions, in 1928 and 1964. Apart from their gold in Atlanta 96, Nigeria have also won both silver and bronze at the Olympics in 2008 and 2016 respectively.
All four quarter-finals are set to take place on Saturday.