South Africa revived their World Cup hopes with a nine-wicket victory over Afghanistan in Cardiff.
Having failed to win any of their first four matches, they dismissed a winless Afghan side for 125 after two rain delays cut the match to 48 overs.
Imran Tahir struck twice in his first over and took 4-29 as the Afghans lost five wickets for eight in 29 balls.
Quinton de Kock made 68 as the South Africans reached their revised target of 127 with 116 balls remaining.
Bowled out for 207 in the opening match to lose to England by 107 runs, further defeats followed against Bangladesh and India for South Africa, with their only point accrued in a fixture against West Indies at Southampton abandoned because of rain.
Premier fast bowler Dale Steyn was ruled out for the rest of the tournament through injury and it was the venerable 40-year-old Tahir who provided the spark against Afghanistan after Faf du Plessis had chosen to field.
Hazratullah Zazai and Noor Ali Zadran played some enterprising strokes to help their team to 69-2 when the lengthier of the two rain breaks arrived, but the resumption proved disastrous for the Afghans in their first ODI against South Africa.
Hashmatullah Shahidi edged the fourth ball of the re-start to slip, the first of four wickets to fall for one run in 10 balls.
Tahir, playing his 103rd ODI, bowled the 21st over and struck with his first delivery - a perfectly executed googly that bowled Noor Ali through the gate - and four balls later Asghar Afghan chipped back a simple return catch after being equally bamboozled.
It needed a cavalier approach from all-rounder Rashid Khan, with three fours in four balls during his 35, to ensure the Afghans reached three figures.Proteas reach revised target to secure first win
An extra run added to their target by the Duckworth-Lewis-Stern method was never likely to inconvenience the South African innings, played in bright evening sunshine, and when Afghanistan's star spinner Rashid came into the attack for the ninth over they were 25-0.
Unlike Tahir, his opening delivery was pulled to the mid-wicket boundary and after a watchful start, the South Africans reached 50 in the 13th over.
De Kock played with impressive freedom on both sides of the wicket to make his fifty from 58 balls, his second half-century of the tournament, sharing his 11th ODI century partnership with Hashim Amla before being smartly caught at mid-wicket.
Burly seamer Andile Phehlukwayo, who had never batted higher than seven in an ODI, was brought in at three to improve the run-rate but it was not until the 29th over that victory was recorded with the only six of the match.
A much greater challenge awaits South Africa in their next match against New Zealand at Edgbaston on Wednesday.