Lahore:South Africa made a stunning comeback on Tuesday to pin down Pakistan's explosive reply on the second day of the second Test.
The home team, trailing 1-0 in the two-match series, was 140-4 at stumps after South African tailenders hung in earlier in the day to post a respectable first innings score of 357.
Inzamam-ul-Haq (10), playing in his farewell Test, and Misbah-ul-Haq (10) were at the crease when bad light stopped play eight overs before scheduled close.
Inzamam - who opted out of the first Test that Pakistan lost by 160 runs last week - had an emotional arrival at the wicket.
All 11 South African players lined up close to the wicket to applaud the 37-year-old former Pakistan captain.
Openers Kamran Akmal (52 off 64 balls) and Salman Butt (40 off 68 balls) made a spirited start of 90 runs off 124 balls before Pakistan lost three wickets in the space of nine runs.
Butt top-edged lanky left-arm spinner Paul Harris and Smith took his second catch when he dived forward and hung onto Akmal's uppish drive in the covers.
Andre Nel knocked back Younis Khan's (3) off-stump and Mohammad Yousuf (25), who missed the first Test on fitness grounds, played across and was adjudged lbw, giving paceman Dale Steyn his 50th Test wicket.
Earlier, Mark Boucher made a resilient 54 and Harris scored a career Test best of 46 to spoil Pakistan's attempt at restricting the visitors.
The pair put together a crucial 88-run eighth wicket partnership and defied Pakistan bowlers for two hours and forty minutes on either side of the first two sessions.
Paceman Umar Gul (3-103) got a much-needed breakthrough when Harris played a loose drive after lunch and spooned a catch to captain Shoaib Malik in the covers. Harris hit six boundaries in his 132-ball knock.
Danish Kaneria (4-114) then clean bowled Steyn without scoring before Boucher completed his 26th Test half century with a pulled six off of Gul.
Boucher, who completed his patient half century in 3-1/2 hours, was the last man to go when he attempted a big shot off Kaneria and Abdul Rehman took a head high catch at the long on boundary.
Boucher received solid support from No 9 batsman Harris, who braved a bouncer from paceman Mohammad Asif that struck him on the ear.
South Africa lost Nel in Gul's first over of the day before adding a run to its overnight score of 259-6. Gul bowled a short delivery and Nel gloved a simple catch to Misbah-ul-Haq close to the wicket.
However, Boucher and Harris then took charge and defied not only Pakistan pacemen but also kept the two spinners - Kaneria and Rehman - at bay as South Africa progressed to 322-7 in the first session.