Chanaka Welegedara and Rangana Herath bowled Sri Lanka into a strong position by stumps on day two of the second Test against South Africa at Kingsmead.
The left-arm seam-spin duo shared nine wickets as South Africa were bowled out for 168 to concede a first-innings deficit of 170.
Sri Lanka lost Tillakaratne Dilshan on the way to 7-1 in their second innings at the close but remain on course for a maiden Test win in South Africa at the ninth attempt.
The tourists' heroics in the field overshadowed the performance of home debutant Marchant de Lange earlier in the day.
De Lange took three wickets in seven deliveries to abruptly end Sri Lanka's first innings, including Thilan Samaraweera for 102.
The 21-year-old fast bowler's figures of 7-81 were the best by a South African against Sri Lanka.
Sri Lanka began day two on 289-7 and their tail lasted almost 20 overs before being all out for 338.
Samaraweera, on 86 overnight, went to his 13th Test century - but only second outside of the subcontinent - from 265 balls.
He was last out shortly afterwards as De Lange, who had dismissed Herath and Welegedara in his previous over, rounded off the third best haul by a South African on debut by having him held on the cover boundary.
Proteas openers Graeme Smith and Jacques Rudolph survived through to lunch at 15-0 but both departed in early afternoon.
Rudolph (7) helped a short ball from seamer Thisara Perera straight into the hands of Welegedara at fine-leg.
And Welegedara followed up by accounting for Smith and Jacques Kallis in successive overs to leave South Africa reeling at 27-3.
Smith (7) was caught behind after being drawn into playing at a delivery he could have left and a flat-footed Kallis pushed an edge to Mahela Jayawardene at second slip for a three-ball duck.
Hashim Amla and AB de Villiers batted throughout the remainder of the afternoon, Amla taking the initiative with 10 fours in his 69-ball half-century, while De Villiers became the sixth South African to reach 5,000 Test runs with a cover driven boundary.
But the fourth-wicket pair's 76-run stand was snapped by Welegedara with the fifth ball after tea, De Villiers (25) reaching out to guide a wide ball to Jayawardene at second slip.
The Matale-born seamer added Amla for 54 in his next over, finding the edge with a delivery that stayed a touch low.
Left-arm spinner Herath chipped in with the next four wickets as South Africa went from 103-3 to 168 all out in under 20 overs.
Herath (4-49) removed Mark Boucher (3), Ashwell Prince (11), Morne Morkel (0) and Imran Tahir (11) before Welegedara completed career-best figures of 5-52 - his second Test five-for - with the scalp of De Lange (9).
At 119-8, South Africa had been in danger of being asked to follow-on but Dale Steyn dispatched two sixes in his 29 not out to ensure they avoided that fate.
And there was still time for Steyn to charge in with the new ball and have Sri Lanka captain Dilshan (4) held at first slip before bad light ended play for the day.