The all-rounder top-scored with 89 in England’s 311 for eight, held a brilliant catch 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.
“We were very good today – we were good as a batting unit even though we couldn’t score a considerable total which was our Plan A,” said England captain Eoin Morgan.
“Ben Stokes has had a full day, his catch was absolutely outstanding. He is a match-winner and lifts everybody.”
“Jofra Archer bowled fast and accurate on a slow pitch, it was outstanding from a young guy,” Morgan added.
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.
Quinton de Kock kept the Proteas in the hunt but holed out off fast bowler Liam Plunkett for 68 and Rassie van der Dussen then made exactly 50 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.
“To be honest I was in the wrong position,” Stokes told the BBC. “That feeling for about five seconds when I was facing the crowd and everyone was cheering, it was phenomenal.”
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 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 almost immediately when Jonny Bairstow was caught behind by De Kock for a golden duck.
Root and Roy repaired the damage and 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).
South Africa captain Faf du Plessis said: “We were outplayed in all three departments.... I thought 300 was par, we were bowling cutters, but there were some really good batting performances from England.”