AHMEDABAD, India (AP) — Rassie van der Dussen’s 14th ODI half-century helped South Africa beat Afghanistan by five wickets at the Cricket World Cup on Friday.

Van der Dussen scored 76 not out off 95 balls as the Proteas finished with 247-5 in 47.3 overs. Earlier, Gerald Coetzee took 4-44 to help bowl out Afghanistan for 244.

Second-place South Africa finishes the league stage with 14 points from seven wins across nine games. Australia can leapfrog the Proteas after its final match against Bangladesh on Saturday.

South Africa seems set to take on Australia in the second semifinal in Kolkata on Nov. 16. Table-topper India is poised to face fourth-place New Zealand in the first semi in Mumbai, unless Pakistan can overhaul the Black Caps in unlikely fashion by substantially improving its net run-rate in its final game against England on Saturday.

Afghanistan is sixth in the table with eight points, its best finish in a World Cup. The rank outsiders, who had only one previous World Cup victory across 2015 and 2019, notched up four wins against England, Pakistan, Sri Lanka and the Netherlands to light up the tournament.

Afghanistan captain Hashmatullah Shahidi was proud of his players. “We fought from ball one to the last ball in every game of the ICC World Cup 2023. I am proud of the performance of my players. We won against big teams and with young players in the current squad, Afghanistan are likely to become a good team in the future,” he said.