Abu Dhabi: Pakistan left-arm spinner Abdul Rehman took three wickets and scored his maiden half-century to foil South Africa's attempts to win the second Test at Abu Dhabi Stadium on Tuesday.
Rehman checked South Africa's quest for quick runs in order to set a target for Pakistan with wickets of Alvior Petersen (35), Hashim Amla (62) and AB de Villiers (25) before South Africa closed the fourth day at 173-4, for an overall lead of 323.
Ashwell Prince was unbeaten on 27 and Mark Boucher was 13 not out on a day when the 30-year-old Rehman became Pakistan's saviour.
Rehman scored a career-best 60 to help Pakistan score 434 in their first-innings in reply to South Africa's mammoth 584-9 declared -- the first time Pakistan crossed the 400-mark in a Test this year.
South Africa, for whom captain Graeme Smith couldn't open the innings after a recurrence of his finger injury, were running out of time to enforce a result in this match and the series which is tied at 0-0.
The first Test ended in a draw in Dubai last week.
Amla and Petersen gave South Africa a flying start of 81 before Rehman put the brakes on their progress, taking three wickets in the space of 36 balls. He removed Petersen, caught by Younis Khan in the last over before tea.
Amla, who completed 1,000 runs in the calendar year with his first shot for boundary, was bowled of an arm ball. Amla hit eight boundaries during his 64-ball rapid innings.
Amla is the third batsman behind Indian duo of Scahin Tendulkar and Virender Sehwag to score 1,000 or more runs in this current year.
In the morning, South Africa started on a positive note when they dismissed Pakistan skipper Misbah-ul-Haq for 77 off the first delivery of the day, trapped leg-before by paceman Dale Steyn.
Rehman then became Pakistan's last hope, adding 36 for the eighth wicket with Umar Gul, who scored 21, to bring Pakistan closer to avoiding follow-on.
When left-arm spinner Paul Harris (3-98) trapped Gul leg-before, Pakistan still needed 32 to avoid the humiliation of being asked to bat again, but Rehman hit Harris for a six and then took a single to avert the danger.
The Rehman-Tanveer Ahmed stand of 59 for the ninth wicket ended when Morne Morkel had debutant Ahmed out soon after lunch for 30.
Rehman hit eight boundaries and a six during his fighting, 139-ball knock, improving on his best score of 25 not out made against the same opponents in Lahore three years ago. Ahmed made 30.
He was the last man out, trapped leg-before by Johan Botha.
South Africa 584 for 9 declared and 173 for 4 (Amla 62, Rehman 3-73)
Pakistan 434 (Azhar 90, Misbah 77, Steyn 4-98)
Status South Africa lead by 323 runs