Opener Stephen Cook scored a career-high century to help South Africa build a massive 432-run lead over Sri Lanka despite rain delays on the third day of the first Test at St George's Park in Port Elizabeth, on Wednesday.
South Africa were 351 for five at the close and in a commanding position to seal victory.
The hosts, with two days left, are likely to put the touring side back into bat early on Thursday, leaving plenty of time to claim the 10 wickets they need to go ahead in the three-match series.
Cook reached his century off 152 balls and went on to score 117 before being caught behind, trying to tickle a ball down to third man but only getting a faint edge to Dushmantha Chameera’s delivery.
Cook shared a 116-run opening partnership with Dean Elgar, who scored 52, and another 105-run stand with Hashim Amla, who was out for 48 off 53 balls.
Elgar top-edged an attempted pull shot and was caught at mid-on off Suranga Lakmal in the first success for the visitors on a track that was supposed to favour the seamers.
Amla, who has struggled with form in recent months, showed aggressive intent when he came to the crease but was trapped lbw by Nuwan Pradeep with the last ball before tea, the 10,000th leg before decision in Test history.
JP Duminy and Temba Bavuma were the other batsmen out with captain Faf du Plessis (41) and Quinton de Kock (42) unbeaten at the end of the day’s play.
It was not a day to remember for Sri Lanka as earlier Vernon Philander completed a five-wicket haul, taking two wickets in the opening over of the day to help dismiss the touring side for 205, leaving them 81 runs adrift of South Africa’s first innings score.
An unusual lightning storm forced the players off after 90 minutes of play in the morning and lunch was taken early.
The afternoon session was also interrupted by rain, but the game was then played out in bright sunshine and the weather is not expected to be a factor for the remainder of the Test.