De Villiers made an unbeaten 101 as South Africa chased down a target of 237 with five wickets and six overs to spare.
For the third successive match, an English batsman made a century but finished on the losing side.
Opening batsman Alex Hales hit 112 but lacked significant support from his teammates as England were bowled out for 236 after being sent in to bat.
The win completed a remarkable turnaround for South Africa after they had been well beaten in the first two matches.
It also marked a return to his best form for De Villiers, who had not scored a century in seven Test and four one-day innings against the tourists.
“I’ve been a little bit off my game in the last month so it’s nice to finish off like that,” said de Villiers.
“It’s an integral part of being the captain and leading from the front, not just in the field, it’s getting runs. I didn’t think we were that far off in the first two ODIs.”
England skipper Eoin Morgan admitted his side had been defeated by the better team.
“We were outplayed today,” said Morgan. “We did have chances earlier in the series to win it but we weren’t quite able to take the opportunities that came.
“We’re a young side, we created opportunities but it wasn’t quite enough.”
De Villiers walked out to bat with his side in trouble at 22 for three, with all the wickets falling to left-arm opening bowler Reece Topley.
But De Villiers and Hashim Amla regained control for South Africa with a fourth wicket stand of 125.
Amla made a relatively restrained 59 off 93 balls and was content to let De Villiers do the bulk of the scoring before he charged a wide ball from Moeen Ali and was stumped.
De Villiers went on to make his 22nd one-day international century and batted for 97 balls, hitting 11 fours and a six.
Hales’ second one-day international century capped a fine series for the tall right-hander, who had made fifties in each of the previous four matches, including an innings of 99 in the second game in Port Elizabeth. He finished the series with 383 runs at an average of 76.60 and was named man of the series.
Joe Root (27) and Ben Stokes (29) were the only other England batsmen to reach 20.
Hales and Root put on 61 for the second wicket, their fifth successive partnership of 50 or more, before Root was trapped leg before wicket by leg-spinner Imran Tahir. Root made 351 runs in the series at an average of 70.20.
Tahir took the first two wickets, dismissing Jason Roy leg before wicket after being brought on in the fifth over.
Tahir ended the innings by having Stuart Broad caught at mid-off to finish with three for 53.
Kagiso Rabada and David Wiese also took three wickets each, for 34 and 50 runs respectively.
Topley gained significant swing at the start of the South African reply and dismissed Quinton de Kock, Faf du Plessis and Rilee Rossouw in an opening spell of three for 21 in five overs. He was less effective when he came back later, finishing with three for 41 in seven overs.