Skipper Faf du Plessis top-scored for the tourists with a fluent 48, while Quinton de Kock contributed 32 as South Africa once again capitulated to the home side's slow bowlers and failed to reach the 150-mark in the series.
Akila Dananjaya (5-52) and Dilruwan Perera (4-40) combined to run through the tourists, who lost all 10 wickets to spin after the home side added 74 runs for the final wicket of their first innings to reach 338 all out.
Sri Lanka won the first test in Galle inside three days to take a 1-0 lead in the series.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
(Reporting by Amlan Chakraborty in New Delhi; Editing by John O'Brien)
