The prolific off-spinner grabbed 6-131 as the tourists, 587 runs behind on the first innings, were bowled out for 434 in their second knock after lunch on the fifth day at the Sinhalese sports club here on Monday.
Muralitharan finished with match figures of 10-172, the 17th time he has taken 10 or more wickets in a match. He also has 54 hauls of five wickets or more in an innings.
Both are world records by a fair distance. In second place are Australian Shane Warne's 10 10-wicket feats and New Zealander Richard Hadlee's 36 five-wicket hauls.
Muralitharan, 34, now has 645 wickets in 107 Tests, second in the all-time list behind Warne's record tally of 685 in 140 matches.
South Africa, who began the final day on a promising 311-4, lost their last six wickets for the addition of 123 runs to concede the lead in the two-match series. The second and final Test starts at the Sara stadium here on Friday.
Wicket-keeper Mark Boucher was the lone batsman to resist the Sri Lankans on the last day with 85.
Muralitharan set South Africa back early when he dismissed captain Ashwell Prince in the second over of the day and removed Herschelle Gibbs at the stroke of the drinks break.
The wily spinner had Prince caught low at slip by Sri Lankan captain Mahela Jayawardene, ending a defiant fifth-wicket stand of 78 with Boucher.
Left-handed Prince added only one run to his overnight score of 60.
Gibbs, who was forced to bat at number seven after being off the field on the third day with a virus, plodded for 32 balls to make 18 until he drove a full toss back to Muralitharan.
Boucher, 38 overnight, continued to defy the Sri Lankans and put on 51 runs for the seventh wicket with Nicky Boje, who remained unbeaten on 33.
South Africa went to lunch at 392-6, still needing 195 runs to avoid an innings defeat.
Boucher added five runs to his lunch score of 80 when he was beaten in flight by left-arm spinner Sanath Jayasuriya and patted back an easy return catch.
Muralitharan clean-bowled Andre Nel and Dale Steyn in the space of 11 deliveries before Lasith Malinga yorked last man Makhaya Ntini to secure victory for his team.
English umpire Mark Benson sat out the final day's play due to a stomach bug and Asoka de Silva of Sri Lanka, the third umpire, took the field with Billy Bowden of New Zealand.
Sri Lanka had piled up 756-5 declared in their first innings with captain Mahela Jayawardene making the fourth highest Test score of 374 after sharing a world record partnership of 624 with Kumar Sangakkara (287).
The batting feast came after South Africa were dismissed for their lowest total against Sri Lanka on the opening day.
The beleaguered tourists, already missing the injured duo of captain Graeme Smith and all-rounder Jacques Kallis, will be reinforced by veteran Shaun Pollock for the second Test.
Pollock, South Africa's leading wicket-taker with 394 Test wickets, missed the first Test following the birth of his second daughter.