England's prolonged push for victory, which started soon after lunch on the fourth day, was finally realized with just 8.2 overs left after a burst of three wickets in 14 balls from allrounder Ben Stokes.
Those final wickets were all caught in the slips, ending with Vernon Philander's edge taken by Ollie Pope to set off wild England celebrations.
England won by 189 runs for its first test success in Cape Town since a team containing Denis Compton and Jim Laker won in 1957. It's right back in this series with tests to come in Port Elizabeth and Johannesburg.
It was also a defining victory for a young England team under captain Joe Root. South Africa had lost just four times in 33 previous tests at Newlands since the country's return to international cricket after apartheid. All four of those losses were to Australia.
"It's a very pleasing performance. The lads really enjoyed it and so they should have," Root said. "We built pressure at the right times, we showed a lot of patience, the character we showed today also going into that last session, to keep believing."
England hit back after losing the first test by 107 runs also chasing a very large total.
"For a young group of players to learn that quickly, really pleasing to see that unfolding," Root said. "For them to learn on their feet ... to learn the hard way."
South Africa survived three full sessions but couldn't quite make it through to the end of the last one. Opener Pieter Malan made 84 in South Africa's second innings on his test debut and batted for more than six hours over the two days. Quinton de Kock added 50. Rassie van der Dussen encapsulated South Africa's stubbornness with 17 off 140 balls.
England's victory eventually came through a mixture of patience and invention on a pitch that flattened out significantly for the bowlers and helped South Africa's final-day cause. England had to change things up.
Two key breakthroughs for England in the final reckoning came as a result of an unorthodox field set by Root. De Kock, South Africa's dangerman, was caught in a packed leg-side field off the bowling of part-time spinner Joe Denly. De Kock had just reached his 50 when he hit a short ball straight to Zak Crawley close at midwicket.
Van der Dussen went just five overs after de Kock, caught at the unusual position of leg slip by James Anderson off Stuart Broad and the double strike knocked the stuffing out of South Africa.
The end came quickly after that.
Stokes took two wickets in two balls when tailenders Dwaine Pretorius and Anrich Nortje fell one after the other. Crawley clung on to his second important catch of the innings when he palmed the edge from Nortje up into the air and then caught it with one hand while lying on his back. Stokes ended it four overs later .
South Africa fought "with everything we've got in us to try and make England do anything and everything to try and beat us," captain Faf du Plessis said. "And they have. They've thrown the kitchen sink at us."
England had South Africa 126-2 overnight. And having taken just two South African wickets in the day's first session, and one in the second session, England romped through the last five wickets for just 11 runs in 17 overs. South Africa went from 237-5 to 248 all out.
England set South Africa 438 to win the test, but that became irrelevant as South Africa attempted to bat out the day for a draw.
Veteran fast bowler Anderson took 2-23 in the innings and seven wickets in the match. Denly had 2-42 and Stokes finished with 3-35 to go with six catches in the match and a blitz of a half-century in England's second innings, which effectively put the test beyond South Africa.
Stokes blasted 72 off 47 balls in a whirlwind of sixes and fours to propel England to 391-8 declared.
Stokes set it up, then finished it.
"He's a born match-winner," Root said of Stokes. "He puts his hand up, he wants to be the one to win you the game."