AB de Villiers helped South Africa to 334-6 on first day of the third Test at the SuperSport Stadium.
South African wicket-keeper de Villiers batted to 98 not-out at close of play on the third day to give the Proteas another solid start to a Test match.
de Villiers and Hashim Amla, who made a sparkling 92, were the only top-order batsmen to play significant innings against a three-man Pakistan bowling attack with only two Test caps between them.
Rahat Ali and Ehsan Adil, neither of whom had taken a wicket in Test cricket before, were responsible for the first five dismissals as South Africa stumbled to 196-5.
Left-arm Rahat, playing in his second Test, took 3-95, while debutant Adil, took 2-54.
Amla looked set for his 20th Test century before edging a drive against a wide delivery from Rahat to be caught behind by wicket-keeper Sarfraz Ahmed.
The opening batsman struck 13 fours in a 128-ball innings and shared partnerships of 69 for the third wicket with Faf du Plessis (29) and 79 for the fourth wicket with de Villiers.
With the South Africans missing star all-rounder Jacques Kallis because of a calf injury, de Villiers took over responsibility for batting out the day.
He shared a sixth wicket stand of 52 with Robin Peterson, who made 28 before being run out, and an unbeaten seventh-wicket partnership of 86 with Vernon Philander – who finished the day on 45 not-out.
Although they produced wicket-taking deliveries, both Rahat and Adil were inconsistent and sent down enough loose deliveries for South Africa to maintain a scoring rate of close to four runs an over for much of the day.
Off-spinner Saeed Ajmal, the only experienced bowler in the side, was easily the most economical, only conceding 70 runs in 26 overs.
Pakistan finished the day a bowler short after Adil limped off with what appeared to be a hamstring strain, after sending down just one delivery with the second new ball.
The injury to Kallis meant a reshuffle to the South African team. He was replaced by fast-medium bowler Kyle Abbott, who earned his first cap after being called into the squad as cover earlier in the week.
South Africa, who have already clinched the series by winning the first two Tests, had one other injury-enforced change, with Rory Kleinveldt replacing fellow fast bowler Morne Morkel.