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 storytelling 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 Newlands pitch.
At various stages it seemed a doomed pursuit in sapping heat, but the tourists rallied triumphantly as time ran out, with Stokes blowing away Dwaine Pretorius and Anrich Nortje with consecutive balls, then finishing off last man Vernon Philander with 8.2 overs remaining.
England results at Newlands since their last victory in 1957.
1996: Lost by 10 wickets
2000: Lost by an innings and 37 runs
2005: Lost by 196 runs
Stokes was named as player of the match for his excellent all-round contribution – 47 and a rapid 72 with the bat, six catches at second slip and those crucial late wickets – but refused to accept he deserved it. Having tried to make Dom Sibley come to the podium to mark his maiden Test century, Stokes put the trophy in his team-mate's bag on arrival in the dressing room. When Sibley tried to return it Stokes left no doubt that he would not be laying hands on it again.
What they said
"He's a golden nugget isn't he? He's just a fantastic specimen really"
England captain Joe Root on his match-winner, Stokes.
Alviro Petersen became the third South African to score a century on Test debut against India in 2010, a fact he alluded to while congratulating Pieter Malan on his impressive effort of 84 at Newlands.
Buttler turns the air blue
As the game edged towards a nail-biting final hour Jos Buttler, normally one of the more mild-mannered players on the circuit, found himself involved in a bitter exchange with Vernon Philander. As well as uttering a few expletives that came through loud and clear enough on the stump mic to put a portion of his match fee in danger, he at one stage appeared to bring the retiring all-rounder's girth into question – suggesting England's fielders might struggle to get the ball past him.
England confirmed that opener Rory Burns would miss around four months after undergoing surgery on his left ankle. That rules him out of the forthcoming series in Sri Lanka, and virtually guarantees Dom Sibley and Zak Crawley will travel. But it also opens the door to Keaton Jennings, who scored a fine century at Galle in 2018 and could find his selection of sweeps and paddles back in demand.
Some welcome time off for both sides after hard-fought back-to-back Tests. They reconvene in Port Elizabeth for the third Test on Jan 16.