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.
|Long earns maiden PGA Tour win at Desert Classic|
|Flanagan resigns as Sharks head coach|
|Rams´ Robey-Coleman admits he committed penalty on controversial no-call|
|NFL admits they blew the call – Saints coach Payton|
|Terrible no-call, Goff shines – three takeaways from Rams´ win over Saints|
|Lonzo Ball to miss 4-6 weeks with ankle sprain|
|Patterson added to Australia Test squad|
|Zuerlein´s overtime kick sinks Saints and sends Rams to Super Bowl|
|It was a clear goal – Valverde dismisses Barca VAR controversy|
|Rashford can emulate Man United greats Ronaldo and Rooney – Solskjaer|
|Karmichael Hunt swaps Reds for Waratahs|
|Barcelona forward Dembele set for tests on sprained ankle|
|Neymar insists Barcelona and Real Madrid links not ´concrete´|
|England trio Nowell, Slade and Cowan-Dickie sign fresh Exeter deals|
|Windies coach Pybus not distracted by detractors|
|Barcelona 3 Leganes 1: Messi and Suarez combine to spare Barca´s blushes|
|I´m sure Michael would be extremely proud - Vettel hails Mick Schumacher|
|Young plays down injury fears for England trio Launchbury, Shields and Hughes|
|Pochettino: Lucas Moura fit for Chelsea clash|
|Ranieri positive on Fulham survival chances despite ´unbelievable´ Spurs loss|
|United Arab Emirates v Kyrgyzstan: Zaccheroni confident in attack|
|South Korea lose Ki to hamstring injury|
|It doesn´t look great - Pochettino to wait on Alli assessment|
|Messi benched as Barcelona face Leganes|
|Dalglish texts me before matches - Van Dijk|
|Patrick Mahomes could sign NFL´s first $200m contract - reports|
|Iran 2 Oman 0: Jahanbakhsh and Dejagah secure last-eight spot|
|Helloooo u remember me? Nkoudou reminds Spurs fans he exists|
|Japan v Saudi Arabia: Pizzi believes Saudis can upset the odds|
|Repsol Honda´s Lorenzo to have surgery on fractured wrist|
|Fulham 1 Tottenham 2: Winks heads late winner after Alli injury|
|Leinster seal home quarter-final with win over Wasps|
|Vince, Curran star as Sixers trounce Heat to move second|
|Sharapova stunned by Barty as Kvitova takes Anisimova to school|
|Guardiola demands improvement after Man City win|
|Sexton has bat phone to referees - Jones|
|Alonso accepts Chelsea guilty of ´silly mistakes´ in Arsenal defeat|
|Guardiola woke us up - Sane reveals half-time rocket for Man City|
|A first step to something bigger - Tsitsipas eyeing glory after shocking Federer|
|Thailand 1 China 2: Gao Lin keeps dream alive for Lippi|
|Tsitsipas in dreamland after ousting Federer, birthday boy Tiafoe breaks new ground|
|Huddersfield Town 0 Manchester City 3: Danilo, Sterling and Sane on target for ton-up City|
|Allegri: Khedira will be like a new signing for Juventus|
|Manchester City reach 100 goals in 2018-19|
|Australia v Uzbekistan: Leckie´s return is ´like a new signing´, says Arnold|
|Jordan 1 Vietnam 1 (aet, 2-4 on penalties): Keeper Van Lam the shoot-out hero|
|Federer confirms French Open return after Melbourne exit|
|I accept his decision - Gattuso axes Chelsea-bound Higuain|
|The rapid rise of Federer-conqueror Tsitsipas|
|Gracious Federer hails ´better player´ Tsitsipas after Australian Open exit|
|Tsitsipas ´happiest man on earth´ after stunning Federer|
|Harden focused on wins, not personal feats after scoring 48 points|
|PSG midfielder Verratti suffers sprained ankle|
|Inspired Tsitsipas dethrones Federer|
|PSG´s Cavani considering career finale in Uruguay|
|Feisty Collins ready to make more noise after thrashing Kerber|
|I´ve got to work on my soccer skills! - Mavs´ Doncic didn´t know ejection rule|
|Lakers won´t rush LeBron & Rondo back despite Ball injury|
|A-League Review: Victory fightback in thriller with Wellington|
|Henry explains foul-mouthed confrontation with Strasbourg´s Lala|
|Nadal wary of ´dangerous´ Tiafoe|
|Emery ´not positive´ over Bellerin injury|
|Harden scores 48 points as Rockets rally past Lakers in OT|
|Pacquiao wants Mayweather rematch after beating Broner|
|Sharapova unimpressed with questions after Melbourne exit|
|Nadal outclasses Berdych en route to quarters|
|Collins trounces 2016 Aus Open champion Kerber|
|Sanchez: Man United thriving thanks to Solskjaer|
|Sharapova crashes out of Australian Open|
|Devils´ Palmieri replaces Hall on NHL All-Star roster|