Isuru Udana's blistering 84 off 48 balls wasn't enough to stop South Africa from clinching the T20I series with a 16-run win in the second match at SuperSport Park.
Udana thrashed the opposition to take Sri Lanka from a seemingly hopeless position to one where they had an outside chance of winning.
It initially looked easy for South Africa, who scored 180 for three after being sent in, with Reeza Hendricks striking a fluent 65 and Rassie van der Dussen a powerfully-struck 64.
Sri Lanka lost their first four wickets in the first four overs and were reeling at 62 for six when Udana walked in to bat.
Udana once again overshadowed the recognised batsmen with a superb display of clean hitting, although he had one let-off when he was caught on the long-on boundary off JP Duminy when on 31, only for Duminy to be no-balled for over-stepping.
"He’s the kind of player we need. He showed his character," said Sri Lankan captain Lasith Malinga, who was disappointed with yet another lack of partnerships.
"It’s really frustrating. We always talk about getting a partnership."
Duminy praised a "really good team performance" and the way Dale Steyn and Chris Morris had struck twice each with the new ball.
"There are a few things we can improve in the middle and end overs. Udana played a fantastic innings but we gave him a few lifelines," he said.
Earlier, Hendricks and Van der Dussen put on 116 off 78 balls for South Africa's second wicket.
Markram opened the batting with Hendricks on Friday but was out for three in the second over.
While man of the match Van der Dussen’s innings was marked by power hitting, which brought him four fours and three sixes, Hendricks oozed class as he struck nine fours in a 46-ball innings marked by fluent off-side drives.