Temba Bavuma and Tristan Stubbs shared 249 runs for the fourth wicket in South Africa’s second innings.
South Africa will return to the field on the verge of near-certain victory on Saturday morning, with Sri Lanka needing to climb a mountain over the last two days of the opening Test in Durban.
Returning to the crease for their second innings on Friday, chasing a monstrous target of 516 runs to win in the final session of day three, Sri Lanka were left flailing.
When stumps were drawn, the tourists had reached 103/5, with Dinesh Chandimal on 29 not out and captain Dhananjaya de Silva not yet off the mark. They still needed 413 to win.
All-rounder Marco Jansen, who took 7/17 in Sri Lanka’s first innings, again led the Proteas attack, taking 2/22. He was well supported by Kagiso Rabada (2/34) as the frontline pair retained control for the hosts, pinning back the touring team’s top order.
Double century partnership
Earlier, after resuming their second innings at 132/3 in the morning session, holding a 281-run lead, the Proteas strengthened their grip on the match with a double-century stand between captain Temba Bavuma and Tristan Stubbs.
Bavuma and Stubbs shared 249 runs for the fourth wicket, carrying their team to 366/5 before they declared at the tea break.
The skipper, who had made a half-century in their first innings, made 113 runs off 228 balls for his third Test century, while Stubbs hit a career-best 122 off 221, racking up his second ton in his sixth Test match.