England must chase down a world-record 474 to win the second Test while South Africa have two full days to bowl them out after the tourists' batsmen provided the strongest possible platform for victory on the third day in Nottingham on Sunday.
It could have even better for South Africa who, after declaring on 343-9 just before the close, thought they had Alastair Cook lbw first ball, although the decision was reversed on review.
England survived two other frenetic lbw appeals before reaching 1-0, still 473 adrift and facing a huge task on a wearing pitch as South Africa push for the victory at Trent Bridge that would level the four-match series 1-1.
No Test team have scored more than 418 to win, while the record at Trent Bridge is a more modest 284-7, which England chalked up to beat New Zealand in 2004.
When South Africa resumed on 75-1, England knew they had to take early wickets and will rue the basic error that allowed Hashim Amla to escape at 91-1 when they failed to review a half-hearted appeal by Stuart Broad. TV replays later showed an edge to the keeper.
Inevitably Amla made England pay, seldom looking troubled by still difficult conditions to make 87 -- his second half-century of the match -- before falling lbw to Liam Dawson on review.
The right-hander shared strong partnerships with Dean Elgar, who made a steadfast 80 after surviving a sharp early chance to Jimmy Anderson, and Faf du Plessis.
Ben Stokes claimed the wickets of both partners: Elgar fell fending away to a ball which rose spitefully while South Africa's captain was trapped lbw by one that kept low after a watchful 63, dismissals that proved why the high-energy Durham paceman was England's most potent bowler.
The day proved a first real captaincy Test for England's Joe Root, seeking to avoid his first defeat as captain in his second match as South Africa threatened to disappear out of sight.
Surprisingly, Root chose not to turn to Moeen Ali, who had taken 10 wickets in the first Test, until 3pm, a decision made more perplexing by his eventual return of 4-78, the best by an England off-spinner on the ground since 1956.
Even the new ball failed to check the tourists, with Vernon Philander (42) and Chris Morris increasing the tempo as the sun came out in the final session.
Morris fell to a good catch by Gary Ballance off Moeen for 13 while Broad bagged an even better one, tumbling to his left on the boundary to dismiss Keshav Maharaj off the same bowler for 1 as South Africa pushed for quick runs ahead of a late-evening declaration.
When it came, their bowlers showed England how tough the next two days will be.
The all-time Test record is held by West Indies, who scored 418-7 to beat Australia in 2003.