Cape Town: England need eight wickets for victory on the final day of the second Test in Cape Town after being frustrated by South Africa's top order on day four.
Dom Sibley made 133 not out for his maiden Test ton and Ben Stokes smashed 72 as England declared on 391-8 to set the Proteas a record 438 to win.
Joe Denly removed opener Dean Elgar (34) before Pieter Malan (63 not out) and Zubayr Hamza held firm.
But James Anderson dismissed Hamza for 18 in the penultimate over of the day.
Anderson's late strike provided England a welcome boost on a Newlands pitch not offering as much variable bounce as they will have hoped by now.
They will still have to work hard and stay patient to secure victory but have time and runs to play with, given the hosts still require a further 312 to win.
Resuming on 85, Sibley made careful progress towards his century, reaching the mark off 269 balls in the 14th over of the day with a firm sweep off Keshav Maharaj for four.
After removing his helmet to acknowledge the crowd and embrace Stokes, the Warwickshire batsman settled straight back into his task, padding away, leaving and waiting for the bad ball.
By stark contrast, Stokes, dropped on 38 by Quinton de Kock, had already smashed his way to a 34-ball half-century by the time Sibley reached three figures.
It was stunning onslaught by the all-rounder, hitting Maharaj down the ground, reverse sweeping medium pacer Dwaine Pretorius and crashing anything over-pitched through covers before he finally holed out to long-on.
Stokes' thrilling knock took the game completely away from South Africa at a stirring pace and was made possible by Sibley's patient accumulation, providing a glimpse of how England may have been able to bat with a more reliable top order in recent years.
Jos Buttler hit two sixes in a brisk 23 and Sibley also showed more invention with a few reverse sweeps before Root finally called his side in 20 minutes after lunch.