|Fifth one-day international, Cape Town:|
|England 236: Hales 112, Rabada 3-34|
|South Africa 237-5: De Villiers 101*, Topley 3-41|
|South Africa won by five wickets|
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.
|South Africa v England ODI series|
|1st ODI, Bloemfontein||England won by 39 runs (D-L method)|
|2nd ODI, Port Elizabeth||England won by five wickets|
|3rd ODI, Centurion||South Africa won by seven wickets|
|4th ODI, Johannesburg||South Africa won by one wicket|
|5th ODI, Cape Town||South Africa won by five wickets|
England master their own downfall
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.
Indeed, no team has ever chased more than a modest 257 to win an ODI at Cape Town and the tourists, after being asked to bat first, were perhaps guilty of setting their sights too high on a pitch that showed regular signs of uneven bounce.
Their recklessness was typified by captain Eoin Morgan, who charged the first delivery he faced from David Wiese, reached for the wide ball and edged behind for only two.
By then, Jason Roy and Joe Root had been trapped leg before by Imran Tahir and, afterwards, Ben Stokes walked too far across his stumps to be bowled behind his legs by Kagiso Rabada, who then had a leaden-footed Jos Buttler play on.
Moeen Ali, Chris Woakes and Adil Rashid all holed out, frustratingly unable to support Hales, as England lost their last seven wickets for 81 runs and were bowled out with five overs to spare.
No storm, but Hales shows his class
After a difficult maiden Test series, Hales showed the sort of temperament needed to succeed in the longer format, standing tall as the entire England batting line-up fell around him.
Wrongly given out caught behind for 20, the Nottinghamshire man successfully reviewed the decision and favoured the area behind square on the off side.
Also accumulating off his pads, Hales became only the fifth England batsman to register five successive ODI half-centuries.
With number 10 Stuart Broad for company, he got through a nervous and lengthy time in the nineties to complete his second century by driving Chris Morris down the ground for four.
By the time he pulled Rabada into the hands of deep square leg, he had taken his tally on the tour to 383 runs, the most ever by an England batsman in a five-match ODI series.
De Villiers snuffs out the hope
|South Africa v England series stats|
|Most runs||Most wickets|
|383 - Alex Hales||10 - Reece Topley|
|351- Joe Root||9 - Kagiso Rabada|
|326 - Quinton de Kock||8 - Reece Topley|
|218 - AB de Villiers||8 - Imran Tahir|
|196 - Hashim Amla||5 - Moeen Ali, Adil Rashid|
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.
What they said
England captain Eoin Morgan: "We want to get to a stage where we can play as aggressive as we can but also play smart cricket. We'd rather err on the side of aggression than the opposite because when we've done that in the past we've fallen well short."
Former England batsman Geoffrey Boycott: "England have come a fair way since the World Cup but they must learn to play to the situation of the pitch. A good cricketer is a thinking cricketer. You have to adapt. Not every pitch is a 350-run pitch."
South Africa captain AB de Villiers: "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."
Two Twenty20s in the build-up to the World Two, the first of which is on Friday in Cape Town at 16:00 GMT.