Seamer Chris Morris was even meaner than Tahir, taking 3-13 in 6.1 overs, and Andile Phehlukwayo finished with 2-18 from eight overs.
The Afghans had hoped to use all their batting overs for the first time this tournament and, before the second break for rain, appeared on the brink of building a reasonable score. However, they lost four wickets in 10 balls for a single run at one stage and stumbled to 77-7 off 25.2 overs before staging a mini-recovery as Ikram Ali Khil and Rashid Khan shared a 34-run partnership for the eighth wicket.
Rashid top-scored for Afghanistan with 35 off 25 balls, including six boundaries, followed by Noor Ali Zadran's 32 runs off 58. Both men fell to Tahir.
Quinton de Kock (68) and Hashim Amla (41 not out) added 104 for the first wicket as the Proteas chased down the total with nine wickets and nearly 20 overs to spare.
South Africa next prepare to play the Black Caps in Birmingham on Wednesday.
- AP