Pakistan beat South Africa by seven wickets in the first Test in Karachi on Friday, taking a 1-0 lead in the two-match series.
Spinner Nauman Ali took 5-35 in his debut match while Yasir Shah grabbed 4-79 as South Africa collapsed for 245 in their second innings.
Pakistan, needing 88 for victory, had reached 22 without loss at lunch with Abid Ali on 10 and Imran Butt on 12, as the home team closed on a 1-0 lead in the two-match series. Both men were dismissed after lunch.
Captain Babar Azam (30) then fell after the break, but Azhar Ali (31) and first innings hero Fawad Alam (4) took their team home.
The writing was on the wall as South Africa lost nightwatchman Keshav Maharaj on the first ball of the day, bowled by pacer Hasan Ali for two.
South African skipper Quinton de Kock had a miserable 50th Test as he followed his 15 in the first innings with just two, caught off a lazy push off Yasir.
Temba Bavuma, who scored 40, added 42 for the seventh wicket with George Linde before being the last man out as Nauman took the last four wickets in his 22 balls.
He dismissed Linde (11), Kagiso Rabada (one), Anrich Nortje (nought) and Bavuma to become 12th Pakistani bowler to take five wickets in an innings on debut.
South Africa is on their first tour of Pakistan for 14 years.