Quinton de Kock ended a streak of near misses with a geharde century for South Africa.
De Kock hit 121 off 108 balls to lead South Africa to 331/5, setting up an easy victory by 71 runs on the Duckworth-Lewis System.
The visitors posted 121/5 from 24 overs in pursuit of a revised total of 193 after play was lost due to the weather.
Kusal Mendis top-scored for the hosts with 41.
With this result, SA clinched the five-match series 3-0.
In the Sri Lankan tour of SA, De Kock had made scores between 80 and 94 in his five previous matches, including two Tests, and his reaction on reaching his 14th ODI ton, off 89 balls, was more relief than ecstasy.
As in the first two ODIs, De Kock made batting look easy as he hit 16 fours and two sixes before being caught behind in the 31st over.
Rassie van der Dussen scored a patient 50 before Andile Phehlukwayo blasted 38 off just 15.
Only Reeza Hendricks failed to get a start, being caught out for 4.
The visitors were on the backfoot from the start.
Kagiso Rabada and Lungi Ngidi struck early for the Proteas after the break before rain stopped play, taking the wickets of Sri Lankan openers Avishka Fernando (23) and Niroshan Dickwella (2).
But there was still time for Imran Tahir to bag the late scalps of Mendis and Perera (12).