Amla and De Kock shared a partnership of 187 as the South African openers got stuck into some mediocre bowling. More than 50 percent of the home side's runs came from boundaries. It took Sri Lanka until the 27th over to make a breakthrough, De Kock being caught on the boundary by Sandun Weerakkody off Suranga Lakmal.
A tiring Amla perished in the penultimate over but not before increasing his scoring rate, taking only 19 balls to add his last 50 runs.
Faf du Plessis made 41 and captain AB de Villiers teased the crowd with some unorthodox strokeplay but lasted only 11 balls.
Sri Lanka lost early wickets but opener Niroshan Dickwella offered the touring side, at the end of a three-month tour, hope of an unlikely victory as he bludgeoned 39 runs off 19 balls before holing out to De Villiers at mid-off from the bowling of Wayne Parnell.
A 93-run partnership for the fifth wicket steadied the innings and Sachith Pathirana made 56.
But with Sri Lanka falling well behind the required rate and the match heading towards a tame finish, 31-year-old Asela Gunaratne brought up his maiden ODI century and finished unbeaten on 114.
Chris Morris was the pick of the hosts' bowlers, finishing with 4-31 in his 10 overs.
(Reporting by Mark Gleeson in Cape Town,; Editing by Ed Osmond)
