The all-rounder top-scored with 89 in England's 311 for eight, held a brilliant catch in the outfield and took two for 12, including the last wicket, as England won with 61 balls left.
Jofra Archer did the early damage with the ball, the fast bowler taking three for 27 in seven overs.
Barbados-born Archer, who only qualified for England in March, made his presence felt even before he had taken a wicket with a bouncer that beat Hashim Amla for pace and crashed into the grille of the helmet, with the veteran opener retiring hurt on five.
Archer then reduced the Proteas to 44 for two.
Aiden Markram edged to Joe Root at slip and South Africa captain Faf du Plessis fell for just five when he top-edged a hook to long leg.
But Quinton de Kock kept the Proteas in the hunt, although the opener was lucky when on 25 he played a ball from leg-spinner Adil Rashid onto his stumps only for the bails to stay put.
The dashing left-hander went on to complete a 58-ball fifty but holed out off fast bowler Liam Plunkett for 68.
Rassie van der Dussen then make exactly 50 without pressing on when he miscued Archer to mid-on.
His exit saw Amla return with South Africa struggling at 167 for six in the 32nd over.
The game was all but up for South Africa when a back-pedalling and diving Stokes held a brilliant one-handed catch in the deep to dismiss Andile Phehlukwayo.
Amla's brave effort to rescue the innings ended on 13 when he was caught behind off Plunkett's slower-ball bouncer and Stokes finished the match when Imran Tahir edged him to Root.
Stokes was one of four England batsmen who got to 50 on a tricky surface, with captain Eoin Morgan (57), Jason Roy (54) and Root (51) all out soon after reaching the landmark.
England lost a wicket second ball before Roy and Root shared a stand of 106 that was equalled by Morgan and Stokes.
Du Plessis opted to field despite being without injured spearhead Dale Steyn and took the unorthodox decision to give leg-spinner Tahir the first over.
The 40-year-old, the oldest player in the tournament, struck second ball when Jonny Bairstow was caught behind by De Kock for a golden duck.
Roy and Root repaired the damage but were dismissed when well set as England lost two wickets for four runs in four balls to be 111 for three.
Morgan, whose aggressive approach has been symbolic of England's rise to the top of the one-day international rankings after their woeful first-round exit at the 2015 World Cup, struck the match's first two sixes off successive balls from Lungi Ngidi before he too was caught in the deep.
Left-hander Stokes saw his 79-ball knock end in the penultimate over when caught at third man following a reverse hit off paceman Ngidi (three for 66). - AFP