South Africa saw off a spirited fightback from Afghanistan to win by five wickets in their final World Cup group game and consolidate second place in the standings.
The Proteas have 14 points from their nine games, two points ahead of Australia who play Bangladesh on Saturday. Both South Africa and Australia have already qualified for the semi-finals.
Afghanistan wrapped up their best ever World Cup campaign with four wins and also sealed a place in the Champions Trophy.
The Asian side opted to bat first and posted 244 in 50 overs on the back of Azmatullah Omarzai's unbeaten knock of 97, which included seven boundaries and three sixes, while Gerald Coetzee was the pick of the South African bowlers with figures of 4-44.
In response, South Africa opener Quinton de Kock set up the chase with a breezy 41 that took him to the top of the tournament's scoring charts on 591 runs.
Rassie van der Dussen (76 not out) then guided the Proteas home, stitching together a 65-run partnership with Andile Phehlukwayo (39 not out), who smashed the winning runs with a massive six over deep mid wicket in the 48th over.


Leclerc laps fastest for Ferrari in first US GP practice
Bayern coach Kompany hospitalised after collapsing during training session
Alexander Volkanovski's title defence headlines UFC 333 in Abu Dhabi
Juventus fight back to draw with Rennes as Leverkusen go top
South Africa level test series with big win over Australia
