South Africa will head into day three of the second Test in Cape Town in a commanding position having reached stumps with a 317-run lead over Sri Lanka.
The hosts began the day on 297-6, with Quinton de Kock leading the way by hitting a Test century before departing the field with a knock of 101 runs.
Sri Lanka bowled their opponents out for 392 in the second session of the day, but in reply they struggled to find rhythm as they lost four wickets for just 60 runs.
Vernon Philander and Kagiso Rabada dominated on the field as they snatched four wickets apiece, while Upul Tharanga top scored with an unbeaten 26 in a disappointing innings for Sri Lanka.
After the tourists were bowled out for 110, the Proteas opted against enforcing the follow-on as Stephen Cook and Dean Elgar extended their team's lead.
The pair will return to the crease tomorrow unbeaten on 15 and 19 runs respectively.