Hashim Amla notched his 20th Test century but three wickets for 34-year-old debutant Zulfiqar Babar allowed Pakistan to restrict South Africa to 245 for eight on the opening day of the first Test in Abu Dhabi on Monday.
Amla, ranked the world's best batsman, provided another innovative display to hit 118 not out while most of his team mates showed some ring rustiness after 10 months without Test cricket.
Spinner Zulfiqar, who became the second oldest debutant for Pakistan, took three wickets in the final session to turn the match back his side's way after Amla had led a South African fightback at the Sheikh Zayed Stadium.
The seamers took three wickets in the opening session but Pakistan lost the initiative between lunch and tea with a bizarre run-out of AB de Villiers their only success.
Then, as the pitch began to turn, Zulfiqar ended a 95-run partnership for the fifth wicket by dismissing JP Duminy.
The spinner also saw Asad Shafiq take a sharp catch at second slip to dismiss Faf du Plessis for one and bowled Robin Peterson for five to finish with three for 89 off 27 overs.
Amla, who struck 13 fours, offered an early chance for a run out while risking a single but after that he proved the backbone of the innings.
Duminy made a good return after an 11-month injury absence from Tests by compiling 57 before skying a top edge to Shafiq.
Earlier, Mohammad Irfan had openers Alviro Petersen (3) and captain Graeme Smith (15) caught before Junaid Khan dismissed Jacques Kallis for five.
De Villiers (19) was removed after lunch when he played an inside edge off Zulfiqar that trickled to Younus Khan at first slip.
Younus threw the ball to wicketkeeper Adnan Akmal to take off the bails while De Villiers, seemingly deep in thought in an uncharacteristic lapse of concentration, was still in an exaggerated forward pose with his back foot not behind the crease.
He was Pakistan's only victim of the second session but the spinners came alive after tea with Saeed Ajmal also claiming a wicket.
The Test is the first in a two-match series in the United Arab Emirates where South Africa face a stiff examination of their top-ranked status.
The matches are being played in Abu Dhabi and Dubai because of the security situation in Pakistan who last hosted a Test on home soil in 2009.
South Africa first innings:
A. Petersen c Shan Masood b Mohammad Irfan 3
G. Smith c Adnan Akmal b Mohammad Irfan 15
H. Amla not out 118
J. Kallis c Adnan Akmal b Junaid Khan 5
AB de Villiers run out 19
JP Duminy c Asad Shafiq b Zulfiqar Babar 57
F. du Plessis c Asad Shafiq b Zulfiqar Babar 1
R. Peterson b Zulfiqar Babar 5
V. Philander lbw b Saeed Ajmal 3
D. Steyn not out 13
Extras (b-1, lb-4, nb-1) 6
Total (for eight wickets, 90 overs) 245
Fall of wickets: 1-6, 2-19, 3-43, 4-104, 5-199, 6-205, 7-217, 8-222
Bowling: Mohammad Irfan 16.2-3-42-2, Junaid Khan 18.4-2-52-1, Zulfiqar Babar 27-2-89-3, Saeed Ajmal 28-6-57-1
Image: Hashim Amla
Photograph: Shaun Roy/Gallo Images/Getty Images