Duanne Olivier took his second five-wicket haul of the match to put South Africa in control against Pakistan on the second day of the first Test in Christchurch.
The 26-year-old, playing just his sixth Test for the Proteas, followed up his 6-37 in the first innings with 5-59 in the second to bowl the visitors out for 190.
Earlier in the day, Temba Bavuma (53) struck his 12th Test half-century and Quinton de Kock made 45 to help the hosts take a 42-run first innings lead before Olivier's heroics left South Africa requiring just 149 runs to claim victory.
Olivier took the first two wickets in Pakistan's second innings as he had Fakhar Zaman (12) caught at long leg before breaking the 65-run second-wicket between Imam-ul-Haq (57) and Shan Masood (65) when he bowled the former.
Olivier's destruction continued when he dismissed Azhar Ali for a third-ball duck, while Asad Shafiq (6) was caught behind off Dale Steyn (2-34) and Babar Azam (6) was bowled by Kagiso Rabada (3-47) as Pakistan lost 5-41.
Pakistan captain Sarfraz Ahmed endured a disastrous time at the crease as he bagged a pair, the 31-year-old well caught by Faf du Plessis second ball after chasing a wide delivery from Rabada.
Paceman Olivier completed his maiden 10-wicket match haul when he bowled Yasir Shah for a golden duck and he took the final wicket of Pakistan's innings - Shaheen Shah Afridi caught at long leg - to finish with 11 wickets in the game.
Watch day three of the first Test between South Africa and Pakistan at Centurion, live on Sky Sports Cricket from 7.55am on Friday.