A century from AB de Villiers gave South Africa a 3-2 one-day series win over England with a five-wicket victory in the decider in Cape Town.
Chasing 237, the Proteas were reduced to 22-3 by Reece Topley before De Villiers shared 125 with Hashim Amla.
De Villiers’ 24th ODI ton, from 94 balls, got his side home in 44 overs.
Earlier, Alex Hales struck a composed 112, but he was let down by a string of poor shots from his team-mates as England were bowled out for 236.
Their third successive defeat is also a third straight loss in which one of their batsmen has made a century as England’s new ultra-aggressive approach to one-day cricket ultimately proved their undoing.
South Africa’s comeback from 2-0 down is only the third time that a five-match ODI series has been won from two behind.
England’s change of style since their awful World Cup helped them to series wins against New Zealand and Pakistan, as well as a narrow defeat by world champions Australia, but here they were too cavalier.
England’s total looked substandard, but they were given hope by left-armer Topley’s use of the new ball.
Quinton de Kock inside-edged behind, Faf du Plessis was bowled first ball by a devastating inswinger and Rilee Rossouw drove to short cover.
However, England were stopped by De Villiers and Amla. Though captain De Villiers belted a free hit from Stokes for six, the experienced pair did little more than absorb the pressure and punish the bad ball.
Amla inexplicably ran past a wide ball from Moeen to be stumped and Farhaan Behardien heaved Rashid to mid-on, but the tension was relieved by Wiese, who hit Rashid for successive sixes.
De Villiers, whose previous highest score in the Test and ODI series was 88, survived a marginal lbw review against Rashid and moved through the nineties with 11 runs in four balls off Topley.
A late cut for a single took him to three figures and, in the next over, the game and the series was won.
South Africa captain AB de Villiers had this to say: “I’ve been a little bit off my game in the last month or so, so it’s nice to finish like that. As captain, you have to lead from the front. I didn’t think we were that far off in the first two ODIs, the belief was still there.”