Karachi:South Africa took charge of the first Test on Tuesday after posting a strong total of 450 against a faltering Pakistan.
Pakistan ended the second day at a dogged 127-5 as its top order collapsed after openers Kamran Akmal (42) and Mohammad Hafeez (34) had provided a brisk start of 71. It still requires 124 to avoid the follow-on.
Captain Shoaib Malik was batting on a patient 9 while Abdul Rehman was not out on 1.
Left-arm spinner Paul Harris (2-18) removed both openers in space of his 14 deliveries with Jacques Kallis holding onto a sharp one-handed reflex catch of Hafeez.
Akmal was promoted in the order after regular opener Salman Butt had to spend 11 hours in the hospital for pains in the stomach. Akmal hit five fours before he was trapped lbw by Harris.
Younis Khan (6) struggled to negotiate the variable bounce for half an hour and was bowled by paceman Andre Nel off a delivery that kept very low.
Kallis also did not have to wait long and bowled Faisal Iqbal cheaply in his second over. Dale Steyn dealt another blow late in the day when Misbah-ul-Haq (23) - returning to the test side after four years - edged a wide delivery.
South Africa was indebted to AB de Villiers' innings of 77 for a healthy first innings total as Pakistan's rookie spinner Rehman (4-105) ran through the long lower order.
De Villiers scored the bulk of runs after Mark Boucher (1) fell to a debatable decision by English umpire Mark Benson in the second session.
Television replays suggested that Rehman's delivery did not make contact with Boucher's bat as he attempted a sweep shot. The ball fell into the hands of wicketkeeper Kamran Akmal.
Rehman, who took 25 overs before he got his first wicket, then mopped up the tail end with three more wickets before De Villiers was yorked by paceman Umar Gul (2-60). De Villiers hit seven fours and a six off Rehman in his two-hour batting stint.
Earlier, South Africa lost century-maker Jacques Kallis (155) and Ashwell Prince (36) before progressing to 385 in the first session after it resumed from the overnight score of 294-3.
Leg-spinner Danish Kaneria (2-124) became the sixth Pakistani bowler to amass 200 test wickets when he caught Prince off his own bowling.
Kaneria also got rid of Kallis as Akmal finally held onto an edge when the batsman attempted to cut the ball off the back foot.
Akmal had dropped Kallis while on 36 on Monday off unlucky Kaneria, who consumed 28 overs before striking his first wicket of the match. Kallis got another chance on 61 when Butt dropped him at mid-wicket on the first day.
Kallis added 73 with Prince for the fourth wicket before he departed after facing 249 balls, hitting 19 boundaries in his five-hour knock.