South Africa clinched the three-match Twenty20 International series against Sri Lanka following their 22-run victory in the second game at Hambantota on Sunday.
Spanked 4-1 in the preceding one-day series, the visitors scored 145 for six wickets before returning to restrict Sri Lanka to 123 for seven to go 2-0 up at the Mahinda Rajapaksa International Cricket Stadium.
Kumar Sangakkara topscored for the hosts with a 35-ball 39 and Thisara Perera was unbeaten on 22 as Sri Lanka lost wickets at regular intervals to finish well short of the target.
Both the teams return to the same ground for the final Twenty20 international on Tuesday.
Opting to bat first, South Africa slumped to 48 for three inside nine overs before JP Duminy (30) and AB de Villiers (15) added 38 runs in 4.4 overs.
It was, however, David Miller's 21-ball 36 that powered them to a challenging total which their bowlers defended with aplomb.
Lonwabo Tsotsobe (2-17) wrecked Sri Lanka's top order while Morne Morkel (2-34) took the important wicket of Sangakkara to derail Sri Lanka's chase.