De Villiers, given the responsibility of filling the number three batting slot, hit 121 off only 85 balls as South Africa piled up 354 for six, a record total in matches between the two countries.
Paul Collingwood hit a defiant 86 for England but the tourists were bowled out for 242 in reply on Friday.
It was South Africa’s first win in eight matches against England, after six defeats and one no-result, and levelled the current series with two matches to play.
De Villiers played some audacious strokes, particularly in the batting power play as he closed in on his fourth one-day international century, at one stage flicking fast bowler Stuart Broad over the head of wicketkeeper Matt Prior for one of his 14 boundaries. There were only 20 balls in his innings from which he failed to score.
South Africa scored 110 runs in the last ten overs of their innings, including 57 in the five-over batting power play.
Home captain Smith was in dominant mood after winning the toss for the sixth successive time at Newlands, a ground where 20 of the previous 25 day-night matches had been won by the side batting first.
Smith said: “It was a terrific innings to watch. AB has been given a lot of responsibility.”
Score board
South Africa
Amla c Prior b Broad 86
Smith b Wright 54
De Villiers c Trott b Broad 121
Duminy c Morgan b Wright 6
Petersen (not out) 51
Boucher c Wright b Broad 22
McLaren b Broad 0
Extras (lb-6, W-8) 14
Total (for 6 wkts in 50 overs) 354
Fall of wickets: 1-107, 2-201, 3-217, 4-312, 5-349, 6-354.
Bowling; Anderson 7-0-55-0, Broad 10-0-71-4, Bresnan 10-0-61-0, Swann 9-0-49-0, Collingwood 5-0-38-0, Wright 8-0-66-2, Trott 1-0-8-0.
England
Strauss c Boucher b Morkel 24
Wright c McLaren b Parnell 24
Trott c Smith b Parnell 9
Pietersen b Duminy 45
Collingwood c Amla b Parnell 86
Morgan c sub b Duminy 0
Prior c Smith b Morkel 16
Bresnan c Smith b Morkel 7
Broad b Parnell 10
Swann (not out) 6
Anderson lbw Parnell 1
Extras (LB-4, W-10) 14
Total (all out in 41.3 overs) 242
Fall of wickets: 1-41, 2-58, 3-58, 4-142, 5-150, 6-214, 7-223, 8-227, 9-236.
Bowling: Steyn 6-0-42-0, Parnell 9.3-1-48-5, Morkel 9-1-39-3, McLaren 5-0-34-0, Van der Merwe 6-0-50-0, Duminy 6-0-25-2.