Hashim Amla's unbeaten fifty steadied South Africa as England pressed with both bat and ball on the third day of the third Test at Lord's on Saturday.
At stumps, the Proteas were 145 for three in their second innings - a lead of 139 - with Amla 57 not out and nightwatchman Dale Steyn nought not out.
South Africa, 1-0 up in the three-match series, only have to avoid defeat to replace England as the world's top-ranked Test side.
Both teams had slumped to 54 for four in their first innings and South Africa were wobbling at 50 for two second time around before Amla, dropped on two, and Jacques Kallis (31) shared a third-wicket partnership of 81.
South Africa lost their first wicket when captain Graeme Smith, who had made hundreds in his two previous Lord's Tests, missed a sweep against off-spinner Graeme Swann and was lbw for 23.
Amla was fortunate when he glanced Stuart Broad down the legside and diving wicket-keeper Matt Prior just failed to cling on to the left-handed chance.
But two balls later, Broad had opener Alviro Petersen, playing across the line of a full delivery, lbw for 24.
Both Amla and Kallis initially struggled against the short ball before Kallis lofted Broad over gully for four.
Amla too found his touch, cutting Swann, who bowled 20 overs unchanged for a return of one for 38, and easing James Anderson off the backfoot.
England first innings (o’night: 208-5)
A Strauss b Morkel 20
A Cook c Kallis b Steyn 7
J Trott lbw b Steyn 8
I Bell c Petersen b Philander 58
J Taylor c Smith b Morkel 10
J Bairstow b Morkel 95
M Prior c Kallis b Philander 27
S Broad c Amla b Steyn 16
G Swann not out 37
J Anderson c Rudolph b Steyn 12
S Finn c Duminy b Morkel 10
Total (all out, 107.3 overs, 489 mins) 315
Fall of wickets: 1-29 (Strauss), 2-38 (Trott), 3-39 (Cook), 4-54 (Taylor),
5-178 (Bell), 6-221 (Prior), 7-252 (Broad), 8-264 (Bairstow), 9-283 (Anderson), 10-315 (Finn)
South Africa second innings
A Petersen lbw b Broad 24
G Smith lbw b Swann 23
H Amla not out 57
J Kallis lbw b Finn 31
D Steyn not out 0
Total (3 wkts, 50 overs, 216 mins) 145
Fall of wickets: 1-46 (Smith), 2-50 (Petersen), 3-131 (Kallis)
But a few overs before stumps, Kallis was lbw to fast bowler Steven Finn, with Australian umpire Simon Taufel's decision upheld on review -- much to the batsman's obvious disappointment.
Amla, however, drove Broad down the ground to complete a 95-ball fifty with his seventh four and, two balls later, elegantly stroked him through extra-cover.
Earlier, Jonathan Bairstow fell just short of a maiden Test hundred as England made 315 in reply to South Africa's first innings 309.
But the recalled Bairstow had the consolation of posting a Test-best 95 after coming in when England had collapsed to 54 for four.
There was extra pressure on the 22-year-old as he had replaced Kevin Pietersen, dropped despite scoring 149 in the drawn second Test at Headingley.
England axed South Africa-born Pietersen for sending "provocative" texts, believed to include criticisms of captain Andrew Strauss, to Proteas players.
Bairstow only made his Test debut in May, at Lord's, but was dropped after his first three matches at this level, all against the West Indies, yielded a mere 38 runs in total.
But the Yorkshireman resumed Saturday on 72 not out, with England then 208 for five.
Vernon Philander struck with the first delivery with the new ball as Prior, on 27, loosely drove at an outswinger and edged to second slip Kallis.
Bairstow, the son of late England wicket-keeper David Bairstow, guided fast bowler Steyn square through the offside for four and clipped Philander through midwicket to go to 90.
But he spent 15 runless balls, all against Morne Morkel, on 95, as the fast bowler tied him down on a sunny day when the blue skies above Lord's offered little assistance to the bowlers.
And tall paceman Morkel was rewarded when he bowled Bairstow, aiming across the line, to end an innings of more than five hours duration featuring 13 fours, with the batsman walking off to a standing ovation from a capacity crowd.
Morkel led the attack with four wickets for 80 runs in 28.3 overs, with Steyn taking four for 94 in 29.