Heavy rain reduced the contest to seven overs a side and South Africa, put in to bat first, ran up an impressive total of 78 for four wickets.
Skipper AB de Villiers played a great hand to score 30 off just 13 balls and JP Duminy provided the finishing touches with a four and a six off the last two deliveries of the innings.
The hosts felt they had the game under control when they picked up both South Africa openers within the first three overs with 27 runs on the board but de Villiers turned the game around with a cameo that included two sixes and one four.
The total proved a steep ask for Sri Lanka and their chase was made even more difficult when flamboyant opener Tillakaratne Dilshan was run out without facing a ball.
The South African bowlers bowled a tight line, and helped by some sharp fielding, restricted Sri Lanka to 46 for five wickets as none of the hosts' batsmen were able to get a start.
De Villiers said the experience of playing rain-shortened games in England helped South Africa on Saturday.
"We played a couple in England towards the end of our series there," de Villiers said.
"We had a little chat before we started because it's not easy to keep the focus with all the rain.
"We spoke about what we learned from England and it was fresh in our minds when we went out.
"I think that definitely helped. The guys were on the button from ball one."
Paceman Dale Steyn was the pick of the bowlers with two wickets for 10 runs off his two overs while his pace colleague Morne Morkel also stifled the scoring, conceding just nine runs off his two overs.
Dilshan Munaweera and Kumar Sangakkara top-scored with 13 runs each as the Sri Lankan batsmen could hit only four boundaries off their seven overs.
Sri Lanka captain Mahela Jayawardene felt that his team was below par in both batting and bowling and the loss of early wickets hampered their plan.
"We probably gave 15 runs extra in the field and didn't bowl to our plans," he told reporters. "Even with the bat we didn't get off to a good start, we lost wickets.
"In a seven-over game you have to throw caution and just try and get bat on ball, which we didn't do."
Both teams have qualified to play in the Super Eight stage of the tournament.
- South Africa