Tom Curran held his nerve as England secured a last-ball, two-run win over South Africa in Durban to take the three-match T20I series to a decider.
The Proteas required 15 from the final over to top England's 204-7 and reduced that equation to five from three after Dwaine Pretorius (25 off 13) smashed Curran for six and four.
But the England seamer (2-45) then limited Pretorius to two runs from the next ball, before pinning him lbw with a yorker and then having Bjorn Fortuin (0) caught ramping to short fine leg off the last delivery after the umpires decided Adil Rashid had not strayed from the inner circle.
An England defeat would have been harsh on Moeen Ali, who clubbed a pulsating 39 from 11 balls and bossed a sixth-wicket stand of 51 in 18 balls with Ben Stokes (47no off 30) as the tourists plundered 79 runs from their final 29 deliveries.
Proteas captain Quinton de Kock was also brutal with the bat, cracking eight sixes in a 22-ball 65 as he posted a South Africa-record 17-ball fifty during a 92-run stand with Temba Bavuma (31 off 29) for the first wicket in 47 balls.
However, the tourists, who lost the opening game in East London on Wednesday by one run, did just enough with the ball and can now wrap up a series victory at Centurion on Sunday after winning a T20I in Durban for the first time.
Ali and Stokes' salvo was the second half-century stand of the England innings, with Jason Roy (40 off 29) and Jonny Bairstow (35 off 17) belting 52 for the second wicket in 25 balls, after Bairstow had been dropped on one by Fortuin off his own bowling.
Andile Phehlukwayo (2-47) broke the stand - which had come about after Jos Buttler (2) slashed Lungi Ngidi (3-48) behind in the third over - when he bowled Bairstow top of off stump, while Roy picked out long-on off spinner Tabraiz Shamsi (1-30) before the halfway mark of the innings.
England scored only 21 runs between overs 10 and 13 and when Eoin Morgan (27) ballooned Pretorius (1-17) into the deep and Joe Denly (1) was bowled off his forearm by a Phehlukwayo leg-cutter in the space of four balls, the visitors were 125- 5 after 15.1 overs and needed an impetus - and Ali provided it.
The all-rounder's lusty blows ensured Reeza Hendricks' 17th over went for 21 and Ngidi's 18th went for 19, although he holed out off Ngidi looking for an eighth boundary of his blistering cameo at Kingsmead.
Stokes' unbeaten 47 was his top-score in T20I cricket but he came close to falling for 34 with Bavuma just failing to take a blinding running catch at long-on - two balls before the same man pouched Chris Jordan (7 off 3) on the run at long-off.
Bavuma was then dropped on 19 by Jordan in his follow through and overturned an lbw dismissal against Rashid on 26 as he he played a secondary role in a rollicking stand with De Kock.
De Kock tonked a Mark Wood (2-39) full toss into the deep after advancing out of his crease, while Bavuma's luck ran out when he gloved Wood down the leg-side as South Africa slipped from 101-1 after nine overs to 131-3 after 14 - David Miller (21 off 16) caught on the boundary by Jordan off Stokes having earlier cuffed Rashid for two sixes.
Rassie van der Dussen (43no off 26) and JJ Smuts (13) kept South Africa in the chase but Jordan (2-31) smashed Smuts and Phehlukwayo's stumps from successive deliveries with pinpoint yorkers before missing out on a hat-trick for the second time in as many games.
Van der Dussen blasted Wood's 18th over for 19 but Jordan shipped only 11 from the penultimate over and South Africa fell short in the last, despite Pretorius' brace of boundaries, as the series remained alive.
Watch the third T20I between South Africa and England, at Centurion, from 12pm on Sunday on Sky Sports Cricket.