London – South Africa were just a session away from replacing England as the world's number one Test side on the fifth day of the third and final Test at Lord's on Monday.
England were 221 for seven at tea, still needing a further 125 runs to reach their daunting victory target of 346.
Wicket-keeper Matt Prior was 35 not out and Graeme Swann 12 not out, with the new ball available to South Africa 10 overs after tea.
At 146 for six, England were facing a crushing defeat but a stand of 62 between Prior and Stuart Broad kept the Proteas at bay.
However, the partnership ended when Broad, on 37, hooked a Jacques Kallis bouncer to Hashim Amla at long leg to give the all-rounder his 50th Test wicket against England.
South Africa, 1-0 up in this series after an innings win at The Oval was followed by a draw at Headingley, only had to avoid defeat at Lord's to replace England at the top of the International Cricket Council's world Test rankings.
History was against England as the most they had ever made in the fourth innings to win a Test was the 332 for seven they posted against Australia at Melbourne back in 1928/29.
Vernon Philander had removed England captain Andrew Strauss, in his 100th Test, and fellow left-handed opener Alastair Cook late Sunday to reduce the hosts to 16 for two at the fourth day's close.
Philander struck again early Monday when he had Ian Bell caught, at the second attempt, for his overnight score of four by Proteas captain Graeme Smith at first slip.
The last thing England needed then was a run out but confusion between Jonathan Trott and James Taylor over a fourth run saw the latter dismissed after Amla's throw was relayed by Dale Steyn to wicket-keeper AB de Villiers.
Jonathan Bairstow, who made a gallant 95 after coming in at 54 for four in the first innings having replaced the dropped Kevin Pietersen, walked out to bat Monday with England in an even worse position at 45 for four.
But he showed his class with several boundaries off fast bowler Steyn, the best a straight drive down the ground.
And leg-spinner Imran Tahir also got the Bairstow treatment, lofted straight and swept for two fours in successive deliveries.
However, shortly after lunch, an entertaining partnership of 89 ended when Bairstow played back to a Tahir delivery that kept low and was bowled for 54 off just 47 balls including eight boundaries.
And 134 for five became 146 for six when Trott, playing away from his body, was brilliantly caught by second slip Kallis off Steyn for 63 after more than three-and-a-half hours at the crease.
Left-handed batsman Broad pulled Steyn for six and Prior reverse-swept Tahir for four but South Africa's grip on the game remained firm.