England were left needing a record fourth-innings chase of 376, even bigger than Ben Stokes' Ashes miracle at Headingley, after a torrid third day of the Boxing Day Test that saw Joe Root and Jos Buttler struck down by illness.
South Africa resumed on 72 for four with the game theoretically up for grabs. But while England once again wrestled with the effects of a sickness bug that has impacted 10 of their touring squad and four backroom staff, the Proteas piled on another 200 runs before being bowled out in the afternoon session.
Jofra Archer finished with his third five-for in seven Tests but also went at six an over as he shipped 102. To win the series opener England would now need to outstrip the Stokes-inspired pursuit of 359 in Leeds and set a new national record.
Openers Dom Sibley and Rory Burns successfully negotiated five overs with the new ball to reach 24, the latter successfully reversing an lbw awarded off Kagiso Rabada's sixth delivery.
Things began to go wrong before a ball had been bowled, Buttler feeling unwell on arrival at the ground, leaving Jonny Bairstow to retake the wicketkeeping gloves.
Root lasted 40 minutes before he left the field, spending an extended period off the pitch before returning looking somewhat under the weather.
South Africa began with a debutant and a nightwatchman at the crease in Rassie van der Dussen and Anrich Nortje but rather than being a soft touch they frustrated England for 90 minutes.
In stark contrast to the tourists, who repeatedly bowled too short, Van der Dussen and Nortje were bouncing with energy. Quick singles kept the scoreboard moving and though there were a couple of risky ones thrown in for good measure, fielders consistently failed to hit the stumps.
Van der Dussen upped the rate by taking Stuart Broad for three boundaries in four balls, one a thick edge past Stokes and two sweet strikes through cover. Runs kept coming, five wides from Broad and a Jofra Archer bouncer disappearing over Bairstow's head for four byes.
By the time Archer had Van der Dussen lbw he had bagged his first Test fifty and shared a stand of 91 – the largest of the match. Two more wickets fell before lunch, Archer finally ending Nortje's resistance, caught by Zak Crawley at short-leg for 40, and Stokes accounting for Dwaine Pretorius.
But Quinton de Kock ensured there was no easing off, racing to 30 not out in 17 balls with two outrageous pulled sixes off Archer and a third maximum sailing off the top edge.
Another 75 runs came in the middle session for the loss of the last three wickets, De Kock edging Stokes, Keshav Maharaj completing Archer's haul and Curran taking his fifth of the match to end Vernon Philander's well-made knock of 46.