Second Test, Colombo (PSS), day three (stumps): South Africa 361 & 257-7 v Sri Lanka 321
Muttiah Muralitharan claimed four South African wickets on day three to keep alive Sri Lanka's hopes of victory in the second Test in Colombo.
Murali now has 654 Test wickets
A back-to-form Herschelle Gibbs steered the visitors towards a lead of 297 by the close when he hit a battling 92.
But Gibbs fell to the spinner just before tea and South Africa, 106-1 at lunch, struggled to 257-7 at stumps.
Murali, who took five first-innings wickets, also dismissed Ashwell Prince, AB de Villiers and Shaun Pollock.
I am pretty happy because we didn't allow the game to slip away
Having taken his Test tally to 650 in the first innings, he currently has 4-86 in the second, one short of equalling his own record of four consecutive 10-wicket match hauls.
Sri Lanka's hopes of going 2-0 up in the series will probably rest on the legendary spinner mopping up the tail quickly on Monday to leave the hosts a chaseable target.
Captain Mahela Jayawardene was upbeat about their prospects of chasing a big total.
"We have never won a Test chasing more than 330, but I think we can win this one," he said.
"It's a fast outfield and our batsmen are in form. I am pretty happy because we didn't allow the game to slip away."
Gibbs admitted: "We still need another 50 runs. A lot will depend on how we bowl with the new ball."
Gibbs had passed 50 just three times in his last 15 Tests
Mark Boucher was unbeaten on 28 at the close, with Nicky Boje with him at the crease.
After starting the day 6-0 in their second innings, South Africa started well with Gibbs reaching 61 by lunch.
Andrew Hall was the only wicket to fall for 32, caught behind driving Farveez Maharoof.
Gibbs, under pressure after three cheap dismissals, batted positively in the morning and then grafted hard during the afternoon as Sri Lanka bowled tightly to defensive fields.
But South Africa lost both Jacques Rudolph and Hashim Amla to run-outs before Gibbs, who had passed 20 only once in his previous 11 Test innings, perished eight runs short of what would have been a 15th Test ton.
After cracking 11 fours and a six in his 190-ball innings, the opener top-edged a sweep off Muralitharan to short fine leg, where Sanath Jayasuriya took a superb catch.
The flow of runs reduced to a trickle after tea as Farveez Maharoof found some reverse swing with the old ball and Muralitharan plugged away.
He was rewarded in the final hour, dismissing Prince and De Villiers (33) in the same over, before Pollock picked out Upul Tharanga at square leg.