A bizarre dismissal suffered by England opener Jason Roy turned the second Twenty20 International's South Africa's way as the Proteas won by just three runs at Taunton on Friday.
The narrow victory saw South Africa level the three-match series at 1-1 as they bounced back from a nine-wicket defeat by England in the series opener at Southampton on Wednesday to set-up a winner-takes-all clash in Cardiff on Sunday.
Quick Single: Stunned Stokes slams 'embarassing' decision
England were on course for an unbeatable 2-0 lead while Roy (67) and Jonny Bairstow (47) shared a second-wicket stand of 110.
But when Roy was given out obstructing the field -- the first time this ever happened in a T20 international -- the innings fell away.
England's cause was not helped by batting second under increasingly dark skies in a match that started at 4pm local time despite a lack of floodlights on the ground, although home skipper Eoin Morgan did field first after winning the toss.
A target of 12 off the last over became four off the last ball after Liam Dawson hit Andile Phehlukwayo for a boundary.
But he could not repeat the trick and South Africa had a morale-boosting victory to follow their first-round exit at the 50-over Champions Trophy, with this win achieved despite the absence of coach Russell Domingo, who had flown home after his mother was involved in a traffic accident.
Durban-born Roy, dropped from England's Champions Trophy semi-final loss to Pakistan after a run of low scores, was in superb form, hitting nine fours and going to his fifty with a six off spinner Tabraiz Shamsi.
Bairstow fell first, chipping man-of-the-match Chris Morris (two for 18) to mid-on.
And then came the turning point.
Roy veered dramatically off a straight course, with the result he placed himself between the incoming throw from Phehlukwayo, which hit him on the heel, and the stumps.
South Africa appealed and, after on-field umpires Rob Bailey and Michael Gough referred the decision, Roy was given out by TV umpire Tim Robinson, the former England opening batsman.
Roy was clearly aghast but Morgan insisted it had been a "50-50 call".
"Everyone in the changing room thought it could go either way, so it’s not massively controversial," Morgan told reporters.
"You can see why the umpires gave him out. We still had me and Jos (Buttler) coming in after that so we had enough firepower and experience to win the game but we didn’t."
Buttler, who made his name at Taunton with Somerset before joining Lancashire, was brilliantly yorked by Phehlukwayo for 10 and Morgan was well caught in the gathering gloom by opposing skipper AB de Villiers - whose reaction indicated he'd seen the ball late.
Earlier, Cape Town-born Tom Curran, a Surrey team-mate of Roy, marked his England debut with an impressive 3-33 from four overs.
The tourists' total of 8-174, with de Villiers' top-scoring with 46, was a significant improvement on Wednesday's 3-142.
Curran, the son of the late former Zimbabwe international Kevin Curran, struck with just his second ball in international cricket when Reeza Hendricks bottom-edged a pull into his stumps.
But fellow opener Jon-Jon Smuts's brisk 45 kept the scoreboard ticking over.
And star batsman de Villiers, as he so often does, upped the tempo further, with four sixes in his 20-ball knock.
They included an extraordinary sweep off one knee against left-arm paceman David Willey that flew into the River Tone before he was dismissed next ball.
Curran had Morris caught in the deep off a slower ball and the 22-year-old cleverly yorked Phehlukwayo for a golden duck.
But Farhaan Behardien added a 32 which proved more than useful.