South Africa 209 for 5 (De Villiers 64, De Kock 45, Hamza 1-25) beat Afghanistan 172 (Shahzad 44, Morris 4-27) by 37 runs
Scorecard and ball-by-ball details
An unconvincing South Africa survived a spirited Afghanistan chase to defend a 200-plus score and get their World Twenty20 campaign back on track. In the absence of Dale Steyn, who was left out for tactical reasons, Chris Morris and Imran Tahir squeezed through the middle period to ensure AB de Villiers' quickfire 64 was not in vain.
Afghanistan's second loss means their chances of progressing to the knockouts are all but over, but they have showed their promise. They kept up with the required run-rate for the first half of their innings and were ahead of where South Africa were at the same stage in their knock, but lost too many wickets to keep going. Afghanistan also did not have a 17th over like South Africa did; de Villiers took 29 runs off Rashid Khan, which ended up being the major difference between the two sides.
In the end, South Africa will be relieved that they were able to defend their total, but disappointed that the margin of victory was not bigger. They tightened up on their discipline in the field but still gave away more extras than their opposition - six wides compared to two from Afghanistan - and did not show the kind of killer instinct that they will need later in the tournament.
They also suffered an injury concern. JP Duminy left the field four balls into Afghanistan's chase with a hamstring strain and was unable to take any further part in the match. Duminy has only just found form again and his availability will be important for the rest of the World T20.
As the same venue where they posted 229 batting first on Friday night, South Africa chose to set a target again. Quinton de Kock picked up from where he left off two days ago and dominated the opening passages of play. De Kock faced all but one delivery in the first two overs and found the boundary five times. Hashim Amla may have wanted to catch up but after one four, gifted a catch to Asghar Stanikzai at mid-off.
South Africa held de Villiers back and sent in Faf du Plessis at No.3. The strategy worked. Du Plessis took on the spin from Mohammad Nabi while de Kock continued to attack in the Powerplay. South Africa finished it on 66 for 1 and 60 of those runs came in boundaries.
When the fielding restrictions were lifted, Rashid put the brakes on with the first boundary-less over of the innings, but du Plessis did not want things to slow down too much. He picked up the pace before being run-out and de Villiers was soon at the crease.
Afghanistan were not under threat immediately while de Villiers settled in and de Kock nicked off. After conceding just 19 runs in three overs after the halfway stage of the South African innings, Afghanistan might have been hopeful of pulling South Africa even further back. But Duminy and de Villiers were wise to the need to accelerate and began to push for runs.
De Villiers should have been caught for 27 when he offered Samiullah Shenwari a return catch but he could not hold on his follow through and Rashid suffered most. He was torn apart in his final over, when de Villiers went over midwicket and down the ground five times. The result? Six, four, six, six and six. South Africa's total went meandering to mighty and 200-plus was within sight. It was up to David Miller to take them there after de Villiers was dismissed. Twenty runs off the final over ensured South Africa had a second straight 200-plus score.
South Africa would have felt fairly safe with 209 on the board, especially as Afghanistan two previous scores over 210 were only achieved batting first, but Mohammad Shahzad threatened to gun down that total all by himself. He began fearlessly against Kagiso Rabada and Kyle Abbott and plundered 32 runs off the first two overs. His partner Noor Ali Zadran did not face a ball until the third over and then, it was only to return the strike to Shahzad.
Morris was brought on in the fourth over and showed improvement from previous performances. He started by holding his length back but then steamed in with a delivery just under 150kph - full and straightening - which splayed Shahzad's stumps.
Asghar Stanikzai and was caught behind in Morris' next over but Gulbadin Naib kept Afghanistan in it and targeted David Wiese, South Africa's replacement for Steyn. Afghanistan reached 10 overs on 103 for 2, 11 runs ahead of where South Africa were at the same stage. Then, Gulbadin was caught behind, Noor Ali was stumped, and Afghanistan were wobbling, still needing 100 runs off eight overs. Their chase was over then and South Africa had the chance to drill home an advantage.
Instead, they allowed Afghanistan to drag it out. Abbott and Morris got the yorker right more often than they did in previous matches and Rabada managed one at the end, but South Africa will not feel it was a complete performance by any means.
Firdose Moonda is ESPNcricinfo's South Africa correspondent