Afghanistan's outside hopes of making the Cricket World Cup semi-finals all but ended Friday after being bowled out for 244 against the Proteas.
Choosing to bat in Ahmedabad, Afghanistan slipped to 116-6 before Azmatullah Omarzai hit an unbeaten 97 for a competitive total but not enough for the huge victory margin that the team required.
South Africa fast bowler Gerald Coetzee took four wickets while spinner Keshav Maharaj returned impressive figures of 2-25 as the Proteas tune-up for their semi-final clash with five-time winners Australia next week.
Quinton de Kock played a key part with his six wicketkeeping dismissals to equal a World Cup record of Australia's Adam Gilchrist (v Namibia - Potchefstroom, 2003) and Pakistan's Sarfaraz Ahmed (v South Africa - Auckland, 2015).
Pakistan, who play England on Saturday, need a mathematical miracle to edge out New Zealand, who are all but through to the semi-finals and a likely clash with toppers India.
Openers Rahmanullah Gurbaz and Ibrahim Zadran started aggressively before Maharaj struck with his first ball to have Gurbaz caught out for 25.
Coetzee sent back Ibrahim in the next over to check the batting surge and Afghanistan slipped from 41-0 to 45-3 when Maharaj had skipper Hashmatullah Shahidi caught behind for two.
Rahmat Shah attempted to rebuild in a 49-run stand with Azmatullah but fell to fast bowler Lungi Ngidi for 26.
Afghanistan lost two more wickets to be in danger of getting bowled out in less than their quota of 50 overs but Azmatullah stood firm to play out the innings.
He put on key stand with Rashid Khan (14) and then Noor Ahmad (26) to thwart the opposition bowling.
Azmatullah, 23, hit his ODI best but missed out on a ton after he just managed a single run in the final over that ended with a run out.
Afghanistan were in the fray for a final-four spot until their heartbreaking loss to Australia on Tuesday when Glenn Maxwell's one-man rescue mission left them on the fringes.
New Zealand's victory over Sri Lanka on Thursday then pushed them further out of contention and with their run-rate in negative figures, their chances of making the semi-finals were bleak.
Scorecard
Afghanistan 244 all out in 50 overs (A. Omarzai 97 not out; G. Coetzee 4-44)
AFP