South Africa v England 2nd Test scorecard - England win by 189 runs
England 269 all out: Stokes 47; Rabada 3-68, Preorius 2-26, Philander 2-46, Nortje 2-56
South Africa 223 all out: Elgar 88, van der Dussen 68; Anderson 5-40, Broad 2-38, Curran 2-39
England 391-8d: Sibley 133*, Stokes 72, Root 61; Nortje 3-61
South Africa 248 all out: Malan 84, de Kock 50; Stokes 3-35, Anderson 2-23, Denly 2-42
Ben Stokes bowled England to an epic fifth-day victory in the second Test at Cape Town, edging a compelling battle of wills with a defiant South Africa.
Stokes claimed the last three wickets in the space of 14 deliveries deep into the concluding session of the match as England wrapped up a 189-run win.
Not only was it a first success for England at the famous Newlands ground since 1957, it was also an outstanding advert for the long-form story-telling that is five-day Test cricket - a format at this very moment in danger of being curtailed by administrators.
Starting the day chasing eight wickets to square the series at 1-1, Joe Root's side still needed five after tea as the Proteas dug deep on a passive surface.
At various stages it seemed a doomed pursuit in sapping heat, but the tourists rallied triumphantly at the death with Stokes blowing away Dwaine Pretorius and Anrich Nortje with consecutive balls, then finishing off last man Vernon Philander with 8.2 overs remaining.
Allied to his six catches at second slip - a joint England record among non-wicketkeepers - and the swashbuckling 72 which bought England time in the second innings, and this completed yet another remarkable chapter for the sport's hero of the hour.
South Africa had performed with admirable determination, Pieter Malan, Rassive van der Dussen and Quinton de Kock grinding out 342 deliveries between them on the day, but England matched their labours and held their catches.
After 137.4 overs in the dirt the celebrations - Chris Silverwood's first as head coach - will taste all the sweeter. As for South Africa, they will rue abject lapses from captain Faf du Plessis and De Kock, who both conjured unprovoked dismissals to undermine the home cause.
James Anderson ended the day stiff, sore and seemingly carrying a niggle but started well by finding nightwatchman Keshav Maharaj's edge.
For almost 18 overs Malan and Du Plessis successfully killed the momentum, Malan habitually leaving the ball unless it demanded attention and Du Plessis appearing ready for a long rearguard. Then a gift.
After nudging 19 from 56 deliveries the skipper shed all of his prior inhibitions as he knelt to sweep Dom Bess into the leg-side. Runs were essentially a non-factor with a distant theoretical target of 438 and Bess had caused precious few problems on a pitch offering only the most gentle turn.
Yet Du Plessis planted his ill-fitting shot straight to Joe Denly at square leg. England were delighted, surprised and relieved in equal share - not least Denly, taking his first catch since his jaw-dropping spill two Tests ago in Hamilton.
With spirits revived by a lunch total of 170 for four, Root's decision to resume with Sam Curran paid off as the left-armer slanted one across Malan, finding some extra bounce and clipping the edge. Stokes held on low, concluding a brave stand comprising 84 runs and 231 dot balls.
Optimism spiked again but was gradually extinguished as Van der Dussen and De Kock chewed through another 169 deliveries before tea, taking the game to its final stanza.
With Anderson ailing Root invested heavily in spin, primarily in the form of 33 overs from Bess, but also in Denly's leg-breaks and his own occasional offerings.
England needed inspiration or aberration and neither seemed to be forthcoming. Anderson, by now clearly unfit, managed two overs at the start of the final session - willing but ultimately unable to offer any more to the cause.
With the field crowding in, occupying a variety of unusual positions, De Kock cashed in on the gaps to reach 50. Perhaps sensing more cheap runs he swung hard at a Denly long-hop, ignoring more conservative measures, and picked out Zak Crawley at short mid-wicket.
Once again a mistake had changed the equation, leaving 25.2 overs to sweep up four remaining wickets. England burned five more of them before Root shuffled Anderson up from mid-on to leg-slip and drew instant gratification.
Broad bowled perfectly to the new plan, sliding one towards leg stump, and Van der Dussen unbelievably obliged as he fed the new fielder. After 17 runs and three and a quarter hours, his resistance was over.
England had 20 overs to take three wickets and in Stokes - hammering in relentlessly from the Wynberg End obliged. First Pretorius offered his outside edge and Root closed his fingers round a tricky catch, then Nortje was dramatically held at third slip by Crawley.
Parrying with one hand and plucking the falling ball with the other, he was smothered by the rest of a crowded cordon. There would be no hat-trick, but it had to be Stokes who applied the finishing touch, Philander prodding to Ollie Pope to conclude the drama.
England captain Root described his side's display as "a brilliant performance by the whole group of players".
"We've shown a great amount of character, patience and a lot of belief today," Root told Sky Sports.
"Credit to South Africa. They threw a lot back at us today and made it very difficult, but the guys really stood up and put in a brilliant performance.
"We also had an unbelievable 12th man with us this week - the crowd have been outstanding. It's been such a great atmosphere, it almost felt like a home game. It's a brilliant way to start the year."
England last won a Test match in Cape Town 63 years ago and Root said it was a significant victory for his young side.
"I've been told that (stat) a lot coming into this game," he said. "For a young group of players, we've got a lot of young players at the start of their careers and to be involved in a Test match like that, to learn from it and be on the right side of a result is great.
"The way we handled some difficult situations. We found ourselves under a lot of pressure, but some individuals really stood up and wrestled the momentum back in our favour.
"The way Jimmy (Anderson) bowled in that first innings was outstanding, backed up brilliantly by everyone.
"Sam Curran came on and changed the game, Bessy (Dom Bess) controlled the (run) rate as well and then you've got guys like Ben Stokes, who can just turn it on for you."