South Africa sealed a 51-run victory in the final Test to win the series 2-0, but England did not surrender their place at the top of the rankings without an exhilarating fight.
On a gripping fifth day at Lord's, the home side attacked throughout to keep a seemingly hopeless cause alive deep into the final session.
When Matt Prior and Graeme Swann added 60 in eight breathless overs after tea, the possibility of England overhauling 346 and completing their highest run chase, started to become real.
Test Match Special Analysis
Jonathan AgnewBBC cricket correspondent
"South Africa have been the better team in every department and I was very impressed, more so than I thought I would be. They have given England an exemplary lesson in how to play Test cricket well. They will be hard to knock off their perch."
Even after Swann was run out for 41 off 34 balls, Prior, who was caught off a no-ball and survived a close stumping appeal, attacked the new ball to the delight of a raucous, partisan crowd.
However, he edged Vernon Philander to Graeme Smith at slip to depart for 73, and Steven Finn was caught by Jacques Kallis at second slip off the next ball as England were bowled out for 294.
Man-of-the-match Philander finished with 5-30 and seven wickets in the match, as well as vital contributions of 61 and 35 with the bat, as South Africa took over at the top of the
International Cricket Council rankings.
It was a sudden end to a breathless final day which saw England's batsmen defiantly play their shots in an attempt to preserve the number one status they claimed with a 4-0 whitewash of previous top side India last summer.
Since then, they have lost six of the 11 Tests they have played, and latterly have had to deal with the text message controversy that resulted in Kevin Pietersen being dropped for this match.
Yet to suggest that the Pietersen issue has had an effect on the series would do a disservice to a South Africa, who, by Andrew Strauss's admission, comprehensively outplayed England.
Over three compelling Tests, the Proteas have placed a higher value on their wickets, bowled with greater hostility and accuracy and been sharper in the field than an England side that
dropped too many catches.
They arrived on the final day knowing that only something extraordinary would prevent them from being crowned the world's best Test side, as England - looking to avoid their first home series defeat since 2008 -
resumed on 16-2.
After Ian Bell wafted Philander to slip and James Taylor was run out by Jonathan Trott as he looked for a fourth, Jonny Bairstow counter-attacked in style.
Playing eye-catching drives on both sides of the wicket, he raced to 50 off only 41 balls, while Trott regularly slashed square during a fifth-wicket stand of 89 that dominated a morning session yielding 104 runs.
However, after Bairstow was bowled for 54 playing back to Imran Tahir and Trott, on 63, was brilliantly caught at second slip by Kallis off Dale Steyn, it seemed England's resistance was finally over.
ICC Test rankings
South Africa - 120 points
England - 117
Australia - 116
Pakistan - 109
India - 104
But still they attacked. Stuart Broad's pull for six off Steyn was a highlight of a thrilling partnership of 74 for the eighth wicket with Prior, and then, after Broad hooked Kallis to fine leg, Swann took up the fight.
With sweeps and reverse sweeps off leg-spinner Tahir, and a little luck against the pacemen, Prior and Swann charged towards their unlikely target, cheered on by a quarter-capacity Lord's crowd making more noise than on any of the previous four days.
The odds of England pulling off a famous win were shortening until, with South Africa's fielders spread to all parts, the visitors got the breakthrough they craved.
Prior tried to steal a single, but Swann was short of his ground at the non-striker's end, despite Tahir having to move to gather JP Duminy's throw.
Prior's near misses provided yet more drama but the impressive Philander returned with the new ball to claim his seventh five-wicket haul in 10 Tests and put South Africa on top of the world.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.