The off-spinner's 55th five-wicket feat, that took his career tally to 650, saw South Africa being bowled out for 361 off the penultimate ball of the day on Friday.
Seamer Lasith Malinga chipped in with 3-81 as South Africa, happily placed on 231-4 at tea, lost six wickets in a dramatic final session on a sporting Sara Oval pitch.
In a day of swinging fortunes, South Africa were reduced to 31-3 by the eighth over before captain Ashwell Prince (86) and A.B. de Villiers (95) put on 161 for the fifth wicket.
The duo, who batted through the post-lunch session, fell in the space of seven overs after tea to hand the initiative back to the Sri Lankans.
Veteran Shaun Pollock marked his return with an unbeaten 57 off 70 balls, sharing a last-wicket stand of 34 with Makhaya Ntini that boosted the total.
Pollock, who missed the first Test due to the birth of his second daughter, hit five boundaries and two sixes before Ntini holded out against Muralitharan after making 13.
South Africa are seeking a series-levelling win after being thrashed by an innings and 153 runs in the first Test at the Sinhalese sports club, in which Muralitharan claimed 10 wickets.
Both camps appeared satisfied with the day's proceedings that saw a fascinating contest between bat and ball.
"We are very happy with the day," said Sri Lanka's Australian coach Tom Moody. "To take 10 wickets after losing the toss is very creditable.
"The pitch has good carry and bounce and is good for batting. What we need now is a good start tomorrow."
Prince said 361 was a "good, competitive" score and looked for early breaks on the second day.
"We had decided not to get bogged down by Muralitharan because that is the only way to play him," the South African captain said. "He may have got five wickets again but we also managed to get a good score.
"A few early wickets with the new ball will put is a good position."
Left-handed Prince, watched by his Indian-origin wife Melissa from the stands, played a captain's knock with 13 boundaries when he was caught behind off Muralitharan off the second delivery after tea.
De Villiers hit 18 fours during a stroke-filled knock when a controversial decision by New Zealand umpire Billy Bowden ended his stay five runs short of a fourth Test century.
Bowden gave the batsman caught behind off Malinga even as television replays showed the bat hit the ground instead of the ball.
Mark Boucher smashed 32 off 41 balls, including three fours in one Malinga over, when he was bowled around his legs by Muralitharan attempting a sweep shot.
The joy of winning the toss had seemed short-lived for Prince as the ball swung and bounced on the fresh wicket to leave South Africa three wickets down by the eighth over.
As the wicket eased up under the hot sun, Hashim Amla began the rescue act with 40 before Prince and de Villiers settled in to hammer the bowlers.
Chaminda Vaas, returning for Sri Lanka after missing the first Test due to a hamstring injury, struck with the second delivery of the match by trapping out-of-form opener Herschelle Gibbs leg-before.
Gibbs, who made 19 and 18 in the first Test, failed to bring his bat down in time and was beaten by a ball that went straight through and rapped his left pad.
The South Africans wore black bands on their arms to mourn the death of Soloman Makosana, the president of the Western Province Cricket Association, in Cape Town early Friday.