Ben Stokes produced an explosive spell of bowling as England beat South Africa by 189 runs inside the last hour of the fifth day of the second Test at Newlands on Tuesday.
The win levelled the four-match World Test championship series.
South Africa were bowled out for 248, with the last wicket falling when only 8.2 overs were left in the match.
Stokes took the last three wickets in the space of 14 balls to clinch the victory. He finished with three for 35.
South Africa defied the England bowlers for most of the day. Only three wickets fell before tea as South Africa defended grimly after starting the day on 126 for two after being set an improbable 438 to win.
Opening batsman Pieter Malan, making his debut, made 84 in 369 minutes and 288 balls before he fell to Sam Curran with the second new ball. But he was the only player to be dismissed before lunch and tea.
It meant England needed five wickets in the last session, with a minimum of 31 overs to be bowled.
Quinton de Kock fell to a rare loose shot after he and Rassie van der Dussen had batted together for more than two hours. De Kock, who made 50, had been troubled by Joe Denly's leg-spinners into rough outside his off stump - but fell to a short ball which he pulled to midwicket.
Van der Dussen batted for 194 minutes and 140 balls, scoring only 17, before falling to a smart tactical move by England. He had been batting solidly against Stuart Broad when James Anderson moved to leg slip and Van Der Dussen promptly glance the next ball straight to Anderson.
Stokes produced an inspired spell of fast, hostile, short-pitched deliveries to have Dwaine Pretorius and Anrich Nortje caught in the slips off successive balls before he took the final wicket when Vernon Philander was caught at gully.-AFP
Scoreboard
==============================================
England, first innings: 269
==============================================
South Africa, first innings: 223
==============================================
England, second innings: 391-8 declared
==============================================
South Africa, second innings (overnight 126-2)
==============================================
P. Malan c Stokes b Curran 84
D. Elgar c Buttler b Denly 34
Z. Hamza c Buttler b Anderson 18
K. Maharaj lbw b Anderson 2
F. du Plessis c Denly b Bess 19
H. van der Dussen c Anderson b Broad 17
Q. de Kock c Crawley b Denly 50
V. Philander c Pope b Stokes 8
D. Pretorius c Root b Stokes 0
A. Nortje c Crawley b Stokes 0
K. Rabada not out 3
Extras: (b4, lb2, nb5, w2) 13
==============================================
Total: (2 wkts, 56 overs) 248
==============================================
Fall of wicket: 1-71 (Elgar), 2-123 (Hamza), 3-129 (Maharaj), 4-164 (Du Plessis), 5-171 (Malan), 6-237 (De Kock), 7-237 (Van der Dussen), 8-241 (Pretorius), 9-241 (Nortje)
Bowling: Anderson 18-9-23-2, Broad 23-8-37-1, Bess 33-14-57-1, Curran 16-4-37-1 (1nb, 1w), Denly 18-4-42-2, Root 6-0-11-0, Stokes 23.4-8-35-3 (4nb, 1w)
Result: England won by 189 runs
Series: The four-match series is level at 1-1
Toss: England
Umpires: Kumar Dharmasena (SRI), Paul Reiffel (AUS)
TV umpire: Chris Gaffaney (NZL)
Match referee: Andy Pycroft (ZIM).