Fast bowler Dale Steyn took four wickets as South Africa seized control of the first Test against Sri Lanka on day two and went to the close on 126 for four, an overall second innings lead of 170 runs at Kingsmead.
South Africa had earlier bowled the tourists out for 191 in their first innings, with the experienced Steyn leading the charge on a slow but seaming wicket.
Captain Faf du Plessis (25 not out) and Quinton de Kock (15 not out) will seek to push the home side past the 250-run lead on the third day, a daunting target against a visiting side that have not passed 300 in any of their last 12 Test innings.
But debutant left-arm spinner Lasith Embuldeniya (2-36) ensured South Africa stuttered in their second innings as he collected the wickets of Temba Bavuma (3) and Dean Elgar (35).
Aiden Markram had the home side off to a positive start with a brisk 28 before he edged seamer Kasun Rajitha to second slip, while Hashim Amla was snatched in the gully off Vishwa Fernando.
South Africa have a long tail with all-rounder Vernon Philander batting at number seven and quick wickets in the morning could bring Sri Lanka back into the contest.
"We want that lead to get up a little bit more tomorrow," Steyn told reporters. "If we bowl anything like we did in the first innings we should be OK. But we do need more runs.
"If you bowl short and aggressive lengths, there is was always a chance of a wicket," he added.
Whatever target they are set, the visitors will have to show more application with bat in hand against a home attack that is expert in their own conditions.
The tourists resumed their first innings on 49 for one on the second morning, but were soon in trouble as Steyn (4-48) struck the opening blow when he trapped Oshada Fernando (19) leg before wicket.
The wily seam of Philander (2-32) then removed Sri Lanka captain Dimuth Karunaratne (30) with the same mode of dismissal.
Top-scorer Kusal Perera (51) and Dhananjaya de Silva (23) added 43 for the sixth wicket with some attacking stroke-play, but their promising partnership ended on the stroke of lunch when the latter was caught by Duanne Olivier in the deep off Kagiso Rabada.
The procession of wickets continued in the afternoon, with Embuldeniya (23) providing some dogged resistance before he was the last man out, caught by Steyn at mid-off to give Kagiso Rabada a second scalp.