Vernon Philander took two Pakistan wickets in a dramatic final session after South Africa capitulated to 262 all out on day one of the final Test of the series at the Wanderers.
The Proteas, eyeing a 3-0 whitewash, were 226-3 at tea but folded in spectacular fashion, losing seven wickets for just 33 runs in Johannesburg on Friday,
Aiden Markram, passed fit after recovering from a thigh injury, top scored with 90 and Theunis de Bruyn fell one short of a half-century before the tourists tore through the South Africa order.
The recalled Faheem Ashraf took 3-57, while Mohammad Amir, Mohammad Abbas and Hasan Ali claimed two wickets apiece as seven fell in just under 17.2 overs - the quicker bowlers thriving in the absence of Yasir Shah (knee).
Philander then shifted the momentum firmly in South Africa's favour by snaring Shan Masood caught behind and removing Azhar Ali in the same fashion from the next delivery, with Pakistan closing on 17-2.
Dean Elgar, captain with Faf du Plessis suspended due to a slow over-rate in the second Test, fell for only five after winning the toss when he was caught behind off Abbas but Markram and Hashim Amla prevented Pakistan from making further early inroads.
Markram played fluently, finding the gaps on both sides of the wicket and he was unbeaten on 78 at lunch after a glorious straight drive off Abbas (2-44) gave him a 14th boundary.
The opener missed out on a fifth Test century when he was strangled down the leg side off Ashraf to end a stand of 126 and Amla (41) followed after edging the recalled Shadab Khan to Asad Shafiq in the slips.
De Bruyn (49) and debutant Zubayr Hamza (41) put on 75 for the fourth wicket, but South Africa fell to pieces after the former was trapped leg before by Abbas.
Amir - who was this week recalled to the ODI squad - had Temba Bavuma and Hamza caught behind and Ashraf took two wickets in as many overs to wrap up the innings in a flash.
The procession of wickets continued when Pakistan started their reply, Masood given out caught behind following a review and Philander drawing an edge from Azhar to leave Pakistan in the mire on 6-2.
Imam-ul-Haq and nightwatchman Abbas were still there at stumps, but Pakistan will need to apply themselves on Saturday as they attempt to secure a consolation victory.
|Kvitova overcomes extreme heat for spot in Aus Open final|
|Man United have their club back – Scholes revels in Solskjaer revival|
|Harden matches another Chamberlain feat with 61-point game|
|Capitals give up fourth hat-trick in five games|
|Durant leaving Warriors would be ´great´ for NBA, says McGrady|
|McEnroe: Serena choked in Australian Open loss|
|De Jong an ´important addition´ at Barca, says Valverde|
|´Better outcome than we originally feared´ – Agent on Anthony Davis injury|
|Pacers sweating on Oladipo injury after Indiana star leaves on stretcher|
|De Jong: I spoke to PSG and City before signing for Barca|
|Guardiola wants finals habit at Man City|
|Lakers star LeBron won´t face Timberwolves|
|Valverde doesn´t regret resting Messi despite Barcelona loss|
|In my heart and in my prayers - Ben Yedder pays tribute to missing Sala|
|Real Madrid reclaim world´s highest-earning club title from Manchester United|
|Messi absence no excuse for Barcelona loss, says Suarez|
|Humble Higuain excited by Sarri reunion|
|He must not come and cry after – Goncalves unapologetic over Neymar injury|
|Serie A record-breaker under Sarri - the Opta numbers behind new Chelsea striker Higuain|
|PSG boss Tuchel ´worried´ after Neymar sent to hospital with another foot injury|
|Coles commits to New Zealand and Hurricanes until 2021|
|Guardiola praises City mentality on ´dangerous´ Burton pitch|
|England won ´attritional´ battle, says Anderson after latest landmark|
|AEK, Brose Bamberg secure last-16 spots|
|Sevilla 2 Barcelona 0: Resting Messi backfires for Copa del Rey holders|
|Sarri: Chelsea players agree with me on motivation comments|
|Morata asked to leave Chelsea a month ago, says Sarri|
|Paris Saint-Germain 2 Strasbourg 0: Neymar suffers injury scare in Coupe victory|
|Anderson´s four-wicket haul rocks Windies|
|Burton Albion 0 Manchester City 1 (0-10 agg): Holders coast through to clinch Wembley return|
|PSG´s Neymar hobbles off in Coupe de France clash|
|De Ligt bored of Ajax departure rumours|
|Piatek completes AC Milan move after Higuain exit|
|Super Bowl LIII: Rams RBs v Patriots RBs|
|Chelsea seal Higuain loan|
|Ismaily kicked out of CAF Champions League after fans throw stones, bottles|
|England star Itoje pens new Saracens deal|
|Palace keeper Hennessey charged over Instagram post|
|Chelsea warn supporters over anti-Semitic chanting ahead of Tottenham EFL Cup tie|
|Joshua primed to make call on next opponent|
|Super Bowl LIII: Brady v Goff|
|Sala search suspended as Cardiff chairman confirms club wanted different travel arrangements|
|Cruyff, Koeman, Kluivert - De Jong following pantheon of Dutch Barca greats|
|Sarfraz apologises for comments picked up by stump mic|
|Djokovic: Pouille deserves top-10 spot|
|Hazard must be more demanding if he wants to leave Chelsea, says Ballack|
|Celtics´ Kyrie Irving to sit out Cavs game with flu-like symptoms|
|Barcelona seal €86m De Jong deal|
|Vietnam v Japan: Moriyasu happy to keep doing just enough|
|Hendricks, De Kock and Steyn join up with Proteas squad|
|Lorenzo excited for ´new level´ at Repsol Honda|
|Fernando replaces injured Pradeep in Sri Lanka squad|
|China v Iran: Queiroz wants to exorcise 2015 quarter-final|
|Balotelli joins Marseille until the end of the season|
|Emery gives Monchi ringing endorsement amid Arsenal sporting director links|
|Larry Fitzgerald returning to Cardinals on one-year deal|
|Watson absence ´an opportunity´ for Scotland hopefuls, says Townsend|
|Pochettino open to new signings but Janssen to remain a Spurs outcast|
|´No trace´ of aircraft so far in Sala search|
|Pochettino will not judge Sarri for criticising Chelsea players|
|From front row to four in a row - Best takes on Farrell at Connect 4|
|Hazard an individual, not a leader - Sarri urges Chelsea star to do more|
|Broad left out of England team for first Test|
|Higuain set to sign for Chelsea but won´t face Tottenham – Sarri|
|McGillvary injury blow for Giants|
|Solari praises Marcelo amid exit rumours|
|A-League Review: Joy and pain for De Jong as Sydney close gap|
|Halfpenny, Davies and Williams set to miss France clash|
|India to rest Kohli from back end of New Zealand tour|
|The hand is good - Farrell expects to be fit to face Ireland|