Khurram Manzoor scored a maiden Test century as Pakistan overhauled South Africa's total on the second day of the first Test in Abu Dhabi for the loss of three wickets on Tuesday.
Manzoor was unbeaten on 131 and Pakistan ended on 263 for three, a lead of 14 runs over South Africa who were bowled out for 249 early in the morning session.
Manzoor became the first Pakistan batsman in a decade to score a Test century against South Africa, whose much-vaunted pace attack toiled with little success on a flat track at the Sheikh Zayed Stadium.
Playing in only his 10th Test, Manzoor dealt confidently with the bowling as he and debutant Shan Masood built the foundation with an opening wicket stand of 135.
They were the first opening pair to compile a century partnership in Pakistan's last 24 Test innings, the previous one coming when the side beat England in Dubai in early 2012.
Masood scored 75 before being trapped leg before wicket by spinner JP Duminy, showing plenty of maturity as he shrugged off a barrage of short deliveries and verbal abuse from an increasingly frustrated South African attack.
The Proteas managed took two wickets in the last session, including the prize scalp of Younus Khan for one after he gloved the ball to gully attempting to fend off a short ball from Morne Morkel.
But captain Misbah-ul-Haq (44 not out) will resume on Wednesday with Manzoor after surviving a scare as South Africa took the second new ball just before close.
South Africa captain Graeme Smith claimed a catch in the slips but television replays showed it had fallen short of his fingers.
Resuming on 245 for eight, South Africa added just four runs in four overs as they lost their last two wickets cheaply.
Hashim Amla, who had been the outstanding performer of the opening day, was out to the second ball of the morning, edging to slip for 118. It was the third wicket of the innings for giant seamer Mohammad Irfan (3-44).
The second match of the two-Test series starts on October 23 in Dubai.
South Africa 1st innings: (overnight 245-8)
A Petersen c Masood b Irfan 3
G Smith c A Akmal b Irfan 15
H Amla c Younus b Irfan 118
J Kallis c A Akmal b Junaid 5
AB de Villiers run out 19
JP Duminy c Shafiq b Zulfiqar 57
F du Plessis c Shafiq b Zulfiqar 1
R Peterson b Zulfiqar 5
V Philander lbw b Ajmal 3
D Steyn st A Akmal b Ajmal 15
M Morkel not out 2
Extras (b-1, lb-4, nb-1) 6
Total (all out, 93.1 overs) 249
Fall of wickets: 1-6, 2-19, 3-43, 4-104, 5-199, 6-205, 7-217, 8-222, 9-245, 10-249.
Bowling: Mohammad Irfan 18.2-4-44-3 (nb-1), Junaid Khan 18.4-2-52-1, Zulfiqar Babar 27-2-89-3, Saeed Ajmal 29.1-6-59-2
Pakistan first innings:
K Manzoor not out 131
S Masood lbw b Duminy 75
A Ali c de Villiers b Philander 11
Y Khan c Petersen b Morkel 1
Misbah-ul-Haq not out 44
To bat: Asad Shafiq, Adnan Akmal, Saeed Ajmal, Zulfiqar Babar, Junaid Khan, Mohammad Irfan.
Extras (nb-1) 1
Total (for three wickets, 84 overs) 263
Fall of wickets: 1-135, 2-173, 3-178.
Bowling: Steyn 16-4-55-0 (nb-1), Philander 14-4-31-1, Morkel 15-4-23-1, Kallis 9-1-28-0, Peterson 18-1-79-0, Duminy 10-1-39-1, Du Plessis 2-0-8-0.
Image: Khurram Manzoor
Photograph: Robert Cianflone/Getty Images