Pakistan spinners Yasir Shah and Nauman Ali took five wickets between them as South Africa was bowled out for 220 all out, but the home side faltered in reply to end the day at 33 for four on the first day of the first test here on Tuesday.
Azhar Ali and Fawad Alam were both unbeaten on five and will resume on the second morning on a wicket already producing both turn and variable bounce, suggesting the visitors' modest first innings score could be par.
In a major blow for the home side, captain Babar Azam (7) was trapped leg-before by spinner Keshav Maharaj just before stumps.
South African fast bowler Kagiso Rabada (two for eight) sent back the Pakistan openers when he bowled Abid Ali (4) and then had debutant Imran Butt (9) caught at short-leg from a vicious rising delivery.
Anrich Nortje then picked up the wicket of Shaheen Shah Afridi (0) with a full delivery, only the fourth ball the hapless nightwatchman had faced.
South Africa was in many ways the architects of its own downfall with the bat, having won the toss in its first test in Pakistan since 2007.
They had two run outs in the top six, while captain Quinton de Kock (15) gave his wicket away with a wild swing across the line to left-arm spinner Nauman (two for 38), who is playing in his first Test at the age of 34.
Opener Dean Elgar (58) was the top-scorer and looked in control until he drove at a wide delivery from Nauman and was caught at slip.
Rassie van der Dussen and Temba Bavuma were both run out, while Yasir (three for 54) picked up the key wicket of of Faf du Plessis (23), who edged to wicketkeeper Mohammad Rizwan.
South Africa had initially included Tabraiz Shamsi as a third spinner in its line-up but he suffered lower back pain in the warm-up and was replaced by seamer Lungi Ngidi.
South Africa 1st innings
D. Elgar c Azam b Nauman 58
A. Markram c Butt b Shaheen 13
R. van der Dussen run out 17
F. du Plessis c Rizwan b Yasir 23
Q. de Kock c Butt b Nauman 15
T. Bavuma run out 17
G. Linde c sub (Nawaz) b Hasan 35
K. Maharaj b Yasir 0
K. Rabada not out 21
A. Nortje b Yasir 0
L. Ngidi lbw b Shaheen 8
Extras (b5, lb1, nb7) 13
Total (69.2 overs, all out) 220
Fall of wickets: 1-30 (Markram), 2-63 (Dussen), 3-108 (du Plessis), 4-133 (de Kock), 5-136 (Elgar), 6-179 (Bavuma), 7-179 (Maharaj), 8-194 (Linde), 9-195 (Nortje)
Bowling: Shaheen 11.2-0-49-2 (3nb), Hasan 14-5-61-1 (2nb), Ashraf 5-0-12-0, Nauman 17-4-38-2 (1nb), Yasir 22-6-54-3 (1nb)
Pakistan 1st innings
Imran Butt c Bavuma b Rabada 9
Abid Ali b Rabada 4
Azhar Ali not out 5
Babar Azam lbw b Maharaj 7
Shaheen Shah Afridi b Nortje 0
Fawad Alam not out 5
Extras (nb3) 3
Total (18 overs, four wickets) 33
To bat: Mohammad Rizwan, Faheem Ashraf, Hasan Ali, Nauman Ali, Yasir Shah
Fall of wicket: 1-5 (Abid), 2-15 (Butt), 3-26 (Azam), 4-27 (Shaheen)
Bowling: Rabada 6-3-8-2 (nb2), Nortje 7-2-20-1, Ngidi 3-0-5-0 (1nb), Maharaj 2-2-0-1.