Vernon Philander and Dale Steyn force Sri Lanka to follow on in the third and final Test in Cape Town.
South Africa need six wickets for victory
Sri Lanka collapsed from 149 for two overnight to 239 all out and, following on, were 138 for four at the close of play on Thursday, still 203 runs behind.
Vernon Philander and Dale Steyn took three first-innings wickets apiece as South Africa seized control of the match.
Philander had Dilshan caught behind by Mark Boucher for five and Jacques Kallis removed fellow opener Lahiru Thirimanne for 30, Hashim Amla taking the catch at short leg. Kallis also took two catches to get rid of Sangakkara (34) and Jayawardene (12), with Imran Tahir and Morne Morkel the bowlers.
Sri Lanka's hopes now rest with Angelo Mathews (28 not out) and Thilan Samaraweera (19 not out).
Steyn put the hosts on the front foot as Sri Lanka lost five first-innings wickets for 70 yesterday morning. The fast bowler had Sangakkara (35) caught by Amla at gully, Samaraweera edged a Philander delivery to Kallis at slip for 11 and Jayawardene (30) did just the same to hand Steyn his second victim.
Steyn struck again to have Mathews (1) caught behind by Boucher before Tahir bowled Tissara Perera for five. Philander then dismissed Rangana Herath for one and Dhammika Prasad for nine before Morkel ended Lokuge Chandimal's resistance for 35.