AB de Villiers marked his 200th one-day international appearance by leading South Africa to a five-wicket victory over England in Cape Town, completing a memorable turnaround to claim a 3-2 series win.
South Africa trailed the five-match series 2-0, but were propelled to a third successive triumph at Newlands on Sunday courtesy of a brilliant unbeaten 101 from their formidable captain.
De Villiers' vital 125-run fourth-wicket partnership with opener Hashim Amla (59) was key to the victory, ensuring a career-best 112 for Alex Hales was not enough for England, who had set an attainable target of 237 after a series of cheap wickets led to them being removed with five overs to spare in their innings.
Reece Topley (3-41) put the Proteas under extreme pressure early in their chase, but the tourists had no answer for De Villiers, who notched his 24th ODI century to guide his team to a series-clinching victory.
England's bid to set a strong total started poorly as they lost Jason Roy (8) early on when he was trapped lbw by Imran Tahir (3-53), a fate shared by Joe Root (27), who was unable to replicate his centuries in Centurion and Johannesburg.
Captain Eoin Morgan's (2) poor series was compounded when he gave himself room but edged David Wiese (3-50) outside off stump to wicketkeeper Quinton de Kock, while Ben Stokes' (29) movement left him open to be skittled by Kagiso Rabada (3-34).
Rabada took his second wicket in three balls when Jos Buttler inside edged him into the stumps for a third-ball duck, but Hales kept motoring forward.
The 27-year-old opener notched his second ODI century, but received little support from the lower order, with Moeen Ali (12) Chris Woakes (0) and Adil Rashid (9) all exiting early.
The tourists' collapse put victory within South Africa's sights, but they looked to be in trouble when Topley dismissed De Kock (4), Faf du Plessis (0) and Rossouw (4) with just 22 runs conceded.
However, the entry of De Villiers steadied the ship, with him signalling his intent with successive fours off Topley in the 10th over.
The captain - whose 101 came off 152 balls - and Amla knew a patient approach would suffice, using their experience to pick moments and gradually clock up runs for the hosts.
Their impressive stand was brought to an end by Moeen (1-37), committing Amla to a delivery which opened him up to a stumping from Buttler, but De Villiers continued to control proceedings - clocking up one maximum and 11 fours.
Although Rashid (1-59) removed Farhaan Berhadien (13), Wiese (41 not out) helped De Villiers to see South Africa over the line with 36 balls remaining after consecutive fours off Woakes (0-32).