He is playing his first tournament since suffering serious injuries in a car accident in December 2022 that kept him out of last year's IPL as well as the 50-overs World Cup in India
Leg spinner Imran Tahir took 4-29 as he engineered an Afghani collapse after a 75-minute rain break as they were dismissed for 125. Chris Morris contributed with figures of 3-13 and Andile Phehlukwayo took two wickets for 18.
The South Africans then set about the slightly adjusted target of 127 from 48 overs in cautious fashion, reaching 131-1 with 19 overs to spare.
Hashim Amla and Quinton de Kock put together a 104-run opening wicket partnership before De Kock was dismissed for 68.