South Africa were all out at 73 runs, their lowest total since readmission to international cricket.
The dismal performance came a day after they were bowled out for just 126, which had been their previous lowest Test innings in Sri Lanka .
Offspinner Dilruwan Perera took six for 32, and veteran left-arm spinner Rangana Herath claimed three for 32, as the pair bowled in an unbroken partnership for 28 overs, after Sri Lanka set South Africa a target of 352 for victory.
Herath moved to ninth on the all-time wicket tally, with 423 career dismissals to his name, while Perera´s five-wicket haul was the sixth of his career.
South Africa´s match aggregate of 199 was 20 runs fewer than Sri Lanka opener Dimuth Karunaratne´s individual score across both innings.
Only three of the visitors made it into double figures, and the highest partnership yielded just 22, as batsmen repeatedly fell in their attempts to take on the Sri Lanka spinners.
South Africa´s top scorer was Vernon Philander, who made 22 not out, with opener Aiden Markram batting out the most deliveries, facing 46 balls for his 19.
Perera made the first breakthrough in the third over after lunch, having opener Dean Elgar stumped, after the batsman ran down the pitch and failed to connect with a turning delivery.
Hashim Amla was caught at leg slip for a duck in Perera´s next over, and Temba Bavuma was caught for two by the same fielder shortly after, reducing South Africa to 24 for 3.
The wickets continued to tumble as Herath began to strike as well, with the next three batsmen out for 11 runs in the space of four overs.
It was not until left-arm spinner Keshav Maharaj joined Philander at the crease with the score on 36 for 6 that South Africa began to show any resistance, and even that partnership was snuffed out in 22 balls.