Captain AB de Villiers smashed an unbeaten 101 in his 200th One-Day International to lead South Africa to a five-wicket victory over England at Newlands and a 3-2 series win.
After being sent in to bat, England spluttered to 236 all out in 45 overs despite a second ODI century of his career for opener Alex Hales.
South Africa were in early trouble as they slumped to 22 for 3 in their reply but a magnificent fourth wicket stand of 125 between De Villiers and Hashim Amla (59) steadied their ship and the captain was there at the end to finish it off as they reached their target with 36 balls remaining.
De Villiers' 24th ODI century came from 94 balls with 11 fours and a six, and would prove the difference between the sides.
South Africa had been in early trouble when Reece Topley (3-41) tore through their top-order with the wickets of Quinton de Kock (4), Faf du Plessis (0) and Rilee Rossouw (4).
But the experienced pair of De Villiers and Amla showed patience and skill to take the game away from England and deny them the chance of becoming the first side in 14 years to win a test and ODI series in South Africa.
Instead, the Proteas are the first team since Pakistan in 2005 to come back from 2-0 down in an ODI series and claim victory, and just the fourth in the history of the 50-over game.
Hales had scored half-centuries in each of the four previous matches in the series but finally converted to three figures, to his obvious relief.
His 112 came from 128 balls and included 14 fours as he showed admirable patience on a wicket that was not coming onto the bat as he might have liked.
The next highest score in the England innings was a brisk 29 from Ben Stokes as a mixture of poor shot selection and accurate home bowling ensured the touring side lost wickets at regular intervals.
Hales put on 61 for the second wicket with Joe Root (27) and 70 for the fourth with Stokes, but there was little else of substance in the innings as captain Eoin Morgan (2) again failed.