Five wickets from bowler Dale Steyn has helped South Africa seize control after day three of the first Test match with Sri Lanka.
After they resumed on 30-0, Sri Lanka soon lost opener Kaushal Silva off the bowling of Steyn, before senior batsmen Kumar Sangakkara and Mahela Jayawardene fell before lunch to leave the hosts on 104-3.
Upul Tharanga had look assured during a fantastic knock that saw him record 14 fours and one six, but JP Duminy struck to take the wicket of the opener for 83.
Much of Sri Lanka's hopes rested on the shoulders of Angelo Mathews, and despite him reaching his half-century, wickets continued to tumble around him as Steyn left Sri Lanka in danger of having to follow on.
Mathews managed to take his side to within 200 runs of South Africa's total, but his dismissal late in the day for 89 left Sri Lanka on 272-8, and it got worse for the home side with the final ball when Suranga Lakmal was removed for six to leave Sri Lanka on 283-9 at stumps.