Nottingham: 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 on Sunday.
It could have even better for South Africa who, after declaring on 343 for nine 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 for seven, which England chalked up to beat New Zealand in 2004.
When South Africa resumed on 75 for one, England knew they had to take early wickets and will rue the basic error that allowed Hashim Amla to escape at 91 for one 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 bearded 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 test 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 for seven to beat Australia in 2003.
South Africa 1st innings: 335
(H. Amla 78, Q. de Kock 68, V. Philander 54; J. Anderson 5-72)
England 1st innings: 205
(J. Root 78)
South Africa 2nd innings
H. Kuhn c Root b Anderson 8
D. Elgar c Anderson b Stokes 80
H. Amla lbw Dawson 87
Q. de Kock c Bairstow b Anderson 1
F. du Plessis lbw b Stokes 63
T. Bavuma c Root b Ali 15
V. Philander c&b Ali 42
C. Morris c Ballance b Ali 13
K. Maharaj c Broad b Ali 1
M. Morkel (not out) 17
Extras (b-8, lb-8) 16
Total (9 wkts decl, 104 overs) 343
Fall of wickets: 1-18, 2-153, 3-154, 4-216, 5-253, 6-275, 7-304, 8-307, 9-343.
Did not bat: D. Olivier
Bowling: J. Anderson 20-4-45-2; S. Broad 19-4-60-0; M. Wood 18-5-68-0; M. Ali 16-2-78-4; B. Stokes 20-4-34-2; L. Dawson 11-1-42-1.
England 2nd innings
A. Cook (not out) 0
K. Jennings (not out) 0
Extras (lb-1) 1
Total (no loss, 4 overs) 1
To bat: G. Ballance, J. Root, J. Bairstow, B. Stokes, M. Ali, L. Dawson, S. Broad, M. Wood, J. Anderson
Bowling: M. Morkel 2-2-0-0; V. Philander 2-2-0-0.