An inexperienced Pakistan pace bowling line-up had South Africa in trouble before AB de Villiers steered the hosts to a respectable total on the first day of the third and final Test at SuperSport Park in Centurion on Friday.
De Villiers made an unbeaten 98 as South Africa reached 334 for six.
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 for five.
Left-arm Rahat, playing in his second Test, took three for 95, while new cap Adil, 19, took two for 54.
Amla looked set for his 20th Test century before edging a drive against a wide delivery from Rahat to be caught behind by wicketkeeper Sarfraz Ahmed.
He 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 becaue 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 (45 not out).
De Villiers faced 179 balls and hit 13 fours.
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, 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, 25, who earned his first cap after being called into the squad as cover earlier in the week.
Abbott topped the wicket-takers in the domestic first-class competition, taking 49 wickets for the Dolphins at an average of 15.36.
It was the first time this season that South Africa had gone into a Test match without seven specialist batsmen.
South Africa, who had 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.
Pakistan made three changes, with Imran Farhat replacing opening batsman Nasir Jamshed, while Rahat and Adil came in for Umar Gul and Tanvir Ahmed.