Chris Morris smashed 62 off 38 balls to see South Africa to a thrilling one-wicket win over England in Johannesburg, with the series now level at 2-2 with one to play.
Joe Root (109) hit his eighth ODI hundred and second-straight in the series, helping England recover from 108-6 after a collapse of 4-13, and set South Africa 263 to win.
England seemed to have a series win within their grasp, reducing the hosts to 210-8 in reply, before Morris blasted South Africa to victory, taking the series to a decider in Cape Town on Sunday.
South Africa won the toss and somewhat surprisingly chose to bowl first on a pitch they smacked 439 on when last playing at The Wanderers.
An early breakthrough, Jason Roy top-edging Kagiso Rabada (4-45) to fine leg, went some way to vindicating their decision, before Alex Hales hit 50 in a partnership worth 69 with Root for the second wicket.
Looking to take the attack to leg-spinner Imran Tahir (3-46) like they had done successfully in the first three ODIs, Hales perished at deep midwicket when attempting a slog-sweep for six.
Tahir then took two wickets in his next over - Eoin Morgan cutting to point and Ben Stokes edging to Hashim Amla, who took a fine catch to his right at slip.
Jos Buttler and Moeen Ali too fell for single-figure scores, both to Kyle Abbott (2-57), the former top-edging an attempted hook onto his helmet which looped back to the bowler, and Amla taking another fine catch to dismiss the latter.
With England reeling at 108-6 at the halfway point of their innings, Root put on a crucial 95 for the seventh wicket with Woakes (33).
Root brought up the England 200, and his century an over either side of Woakes' wicket - top-edging Rabada behind - in the 42nd.
A useful cameo from Adil Rashid (39 off 26 balls) helped England up to 262 before he was the last wicket to fall, a tiring Root having scooped to fine leg, and Stuart Broad picking out long-on.
Broad's return with the ball got off to a better start, bowling Hashim Amla in the first over as the opener chopped onto his stumps.
The in-form Quinton de Kock (27) - scorer of two centuries in the series - and Faf du Plessis (34) recovered from the early blow, before a break for bad light due to a floodlight failure seemed to disrupt the South African innings.
Stokes (2-46) and Woakes (1-42) both struck with the score on 63, Stokes benefitting from another drag on by De Kock, and Woakes sending the stumps splattering when clean bowling Du Plessis with a beauty.
Drops of JP Duminy (31) by Hales on one and AB de Villiers (36) by Roy on nine, as well as a strong lbw shout against Duminy being turned down, denied England further breakthroughs and De Villiers in particular cashed in after his reprieve.
He blasted Broad (1-55) for a four next ball and then a straight six as the seamer struggled following his early wicket.
Woakes eventually dismissed the ever-dangerous De Villiers, running out the South African skipper with a direct-hit and Duminy departed soon after, with no doubt this time as he was trapped lbw by Rashid on the back foot.
A couple of terrific catches - Reece Topley (2-39) off his own bowling to remove Farhaan Behardien (38) and Morgan snaffling David Wiese (21) at cover off Stokes - saw England move closer to a series-clinching win.
Topley removed Rabada for a duck - caught by Root at slip - but Rashid then dropped Morris in the deep in the same over.
It proved to be a costly error as Morris struck four sixes and three fours on his way to his match-winning fifty. Although he fell - bowled by Rashid's googly - with one run still needed for victory, Tahir tucked away the winning runs next ball.
Watch highlights of a thrilling fourth ODI between South Africa and England at 10pm on Sky Sports 3, then join us for the series decider in Cape Town from 7.30am on Sky Sports 2 on Sunday.