JP Duminy scored 30 off 23 balls and David Miller hit an aggressive 21-ball 36 as the Proteas reached 145-6 after electing to take first strike in the day-night match.
Fast bowlers Lonwabo Tsotsobe and Morne Morkel then claimed two wickets each as Sri Lanka, the world's top-ranked Twenty20 side, were restricted to 123-7 by an impressive South African fielding display.
Kumar Sangakkara played a lone hand for the hosts with an attractive 39 off 35 balls, but he was only one of three batsmen who crossed 30 in difficult conditions for both teams due to the stiff breeze.
The series win helped South Africa salvage pride after an embarrassing 4-1 defeat in the preceding one-day internationals.
The tourists, who won the first Twenty20 game by 12 runs in Colombo on Friday, will be looking to secure a series whitewash when the final match is played in Hambantota on Tuesday.
Left-armer Tsotsobe removed danger man Mahela Jayawardene and captain Dinesh Chandimal in his first three overs with both batsmen falling to catches by wicket-keeper Quinton de Kock.


Latest News from Sports News Desk