Second one-day international, Southampton:England 330-6 (50 overs): Stokes 101 (79), Buttler 65* (53)South Africa 328-5 (50 overs): De Kock 98, Plunkett 3-64England won by two runsMatch scorecard
Mark Wood bowled a brilliant final over to give England a two-run win over South Africa that sealed the one-day international series in Southampton.
The Proteas needed seven from the 50th over, but Wood limited them to four.
Ben Stokes, an injury doubt before the game, was dropped twice in making a 79-ball 101 that helped England to 330-6.
Quinton de Kock (98), AB de Villiers (52) and David Miller (71 not out) led the chase, but Chris Morris could not hit the last ball for four.
series concludes at Lord's on Monday in what will be England's final
game before they begin the
Champions Trophy against Bangladesh at The Oval on Thursday.
Not only will they start as favourites with the bookmakers, but also on the back of a series victory against the world number ones.
- Relive England's thrilling victory with full video highlights
Wood holds nerve in final-over thriller
Mark Wood conceded only 48 runs from his 10 overs
England's batting is their great strength in ODIs - they have scored runs more quickly than other side for the past two years - but their bowling could be seen as a weakness, leaking runs faster than all teams but Sri Lanka.
Wood had his winter wrecked by injury, but his pace offers a wicket-taking threat, albeit he struggled in the opening win at Headingley on Wednesday.
South Africa were ahead of the chase throughout, even after De Kock and De Villiers departed in the space of four overs after sharing a stand of 96.
Miller arrived to muscle the ball to the leg side, while Morris punished any error in length - at one point Wood and Jake Ball conceded 20 runs in the space of six balls.
With 10 balls remaining, South Africa needed only 10, but Ball regained his composure to make that seven from six.
England took their time, the impressive Wood consulted with captain Morgan after every delivery and South Africa barely laid bat on ball.
Stokes makes South Africa pay
Asked to bat, England were wobbling at 80-3 and could have been in a worse position. Stokes was reprieved on nought off the spin of debutant spinner Keshav Maharaj - Hashim Amla did not even get a hand on the slip catch - and, from the next ball, wicketkeeper De Kock spilled a tougher chance.
The left-hander made the Proteas pay in a second ODI ton full of power on the leg side and down the ground.
He shared stands of 95 with Morgan and 77 with Jos Buttler, who overcame an uncertain start to post a welcome 65 not out from 53 balls.
Stokes cleared the leg-side fence three times, his second 50 coming in only 29 balls before he was caught at long-off from the bowling of Maharaj.
He then took the ball to claim England's first wicket - Amla caught at extra cover - but the knee problem limited the Durham man to only three overs in what is undoubtedly a concern ahead of the Champions Trophy.
South Africa fall short again
In the first ODI at Headingley, South Africa made a strong start in a chase of 340, only to fall away. Then they contributed to their own downfall, but here they were squeezed out by England.
While De Kock and De Villiers were together, South Africa were cruising. De Kock, who survived a very tough caught-and-bowled chance to Stokes on 22, targeted mid-wicket, while De Villiers characteristically scored through 360 degrees.
But after De Villiers gloved a Liam Plunkett short ball through to wicketkeeper Buttler, an increasingly twitchy De Kock edged a Moeen Ali off-break to the same man.
Miller received little support from Farhaan Behardien, but the arrival of Morris once again made the highest successful run-chase by a visiting team in England seem possible. That was until Wood's final over.
Defeat from the jaws of victory - what they said
England captain Eoin Morgan: "Those are the sort of games you really want to win, you learn a more from these games.
"It really got away from us for a while but Mark Wood coming up with the goods at the end was awesome.
"The Champions Trophy is bound to be tight so this preparation is ideal. It helps us massively for the tournament.
"Woody usually bowls yorkers but he adjusted to conditions at the end with the short ball and it was really impressive."
Man of the match Ben Stokes: "Mark Wood bowled really well and it was an amazing effort from him.
"It shows what a bit of pace does - it makes it harder for batsmen at the end to strike the ball cleanly.
"Batting is fine but my bowling is affected by my knee. I'm not quite sure what it is but I have a couple more scans to come and hopefully it will settle down."
South Africa captain AB de Villiers: "I thought the boys played exceptionally well but England got their plans right and showed guts at the finish.
"The result is unfortunate but I'm proud of the way we played. I thought we paced it really well but we couldn't cross the line.
"I think our fielding was costly. We were a little bit careless at times, conceding one or two more boundaries than we should have done."
Former England off-spinner Graeme Swann: "That's a brilliant series win and on the brink of a major tournament in this country it's a fantastic win from that situation. Somehow Jake Ball and Mark Wood have only gone for a run a ball - quite brilliant death bowling.
"South Africa can't believe they haven't won that. England have snatched victory from the jaws of defeat."