South Africa turned the screw in the second Test against Sri Lanka as they moved within six wickets of a series victory on another dominant day in Cape Town.
The Proteas controlled the opening two days at Newlands as Sri Lanka were skittled for 110 in reply to South Africa's first-innings total of 392.
And their lead only increased on Wednesday, with Dean Elgar (55) and Faf du Plessis (41) leading them past a lead of 500, the hosts declaring on 224-7 after starting the day 35 without loss.
Faced with a mammoth target and more than two days at the crease to survive, Sri Lanka made a sorry start as Vernon Philander reduced them to 25-2 inside 10 overs.
Another two wickets fell before the close as South Africa closed in on another win, while Sri Lanka's hopes rest on the unbeaten partnership between Angelo Mathews (29 not out) and Dinesh Chandimal (28 not out).
The pair reached stumps with an unbeaten partnership of 61, the tourists still trailing by 377 runs as they look to stay alive in the series.
-- Cricket South Africa (@OfficialCSA) January 4, 2017
Tasked with increasing South Africa's lead quickly on day three, Elgar and Stephen Cook (30) added 29 to their overnight score before the latter became the first of Suranga Lakmal's four victims.
With the hosts keen to push on there were plenty of opportunities for Sri Lanka, Lakmal profiting the most with a spirited 4-69 which included removing the out-of-form Hashim Amla for a duck - his 10th innings without a half century.
After his stunning 129 in the first innings, Elgar was lifting his bat to the Cape Town crowd for a third time as he top-scored with 55, while JP Duminy (30) and Du Plessis added quick runs in the middle order.
Quinton de Kock (29), Keshav Maharaj (20 not out) and Philander (15 not out) supplied the late runs before the latter set about bowling his side to victory with a stunning opening spell.
Having built up pressure on both openers, Philander (2-34) sent Dimuth Karunaratne (6) packing with a swinging delivery that caught an inside edge and sent the leg stump cartwheeling.
Kusal Mendis (4) followed soon after with an edge to Elgar at third slip and things were looking bleak for Mathews' side.
Brief resistance from Kaushal Silva (29) and Dhananjaya de Silva (22) left Sri Lanka 69-4, but Mathews and Chandimal were able to stave off another collapse as they reached stumps 130-4.