Pakistan were 242 for five at the close, with captain Inzamam-ul-Haq unbeaten on 35.
It could have been better for Pakistan. Vice-captain Younis Khan shared a 133-run third wicket partnership with Yasir Hameed as the total climbed to 183 for two.
Then Khan hooked against Shaun Pollock and was caught at fine leg after making an impressive 68.
Three overs later Hameed played a similar shot and was caught at deep square leg off Andre Nel for 65.
Faisal Iqbal made only one before the hook was his undoing as well, when he gloved a simple catch to wicketkeeper Mark Boucher off Jacques Kallis. It was Boucher's 367th catch, a Test record, although he remains 13 behind former record-holder Ian Healy of Australia in total dismissals.
Younis said he had no regrets about his dismissal.
"It happens in Test cricket. You lose one wicket and then you lose two or three," said the vice-captain.
"The main thing was that after we lost two wickets early on, me and Yasir played a little bit of aggressive cricket, not on the back foot. On these type of pitches you must be the aggressor, especially against a side like South Africa who are always coming at you in your face."
Meanwhile, Boucher said that 350 was a benchmark total on a pitch which he felt was "a bit two-paced."
"Picking up three wickets in the last session was a big bonus for us. The game's probably on an even keel," he said.
Hameed took advantage of his first opportunity at Test level since June 2005 as he and Khan set a new record for the third wicket for Pakistan against South Africa.
Hameed came into the side at number three with Khan moving down to four to fill the gap left by Mohammad Yousuf, who is in Pakistan with his wife, who is due to have a baby.
Khan and Hameed came together shortly before lunch after South African fast bowler Makhaya Ntini struck twice within five balls to end a promising start by the tourists.
Mohammad Hafeez and Imran Farhat put on 48 for the first wicket after Inzamam won the toss and decided to bat on an easy-paced pitch.
But Ntini dismissed both openers shortly before lunch.
Khan and Hafeez batted soundly to reduce the South Africans to setting largely defensive fields on a stiflingly hot day.
Khan was first to his fifty, reaching the mark off 78 balls with eight fours, but Hameed reached his half-century in more spectacular fashion, flicking Jacques Kallis off his toes for the first six of the match. Hameed took 102 balls and hit seven fours and a six.
Khan faced 110 balls in total, adding two more boundaries, before his dismissal, while Hameed faced 135 deliveries.
Pakistan's mini collapse was halted by Inzamam and wicketkeeper Kamran Akmal, who stayed together until the close.
Earlier, Ntini bowled a poor first spell, conceding 14 runs in four overs without looking like getting a wicket, while new ball partner Andre Nel gave both batsmen some anxious moments.
The left-handed Farhat played and missed several times and was missed on 14 when he top-edged a pull against Nel and Paul Harris at mid-on turned awkwardly and could not get to the ball.
Ntini replaced Nel at the Hennops River end, where there seemed to be more bounce for the bowlers, and had Farhat caught at backward point for 26 when the batsman played a loose shot.
In his next over Ntini claimed the wicket of Hafeez for 19, with a ball which seamed back at the right-hander as he tried to withdraw his bats.
Hafeez looked unhappy when he was given out by umpire Steve Bucknor but a slow motion replay showed the ball brushed his glove before being caught by wicketkeeper Mark Boucher.
Boucher was playing in his 100th Test, of which 99 have been for South Africa and one for the World XI against Australia last season.
Ntini took two for 52.
South Africa made one change from the side that beat India in Cape Town last week, with Andre Nel replacing Dale Steyn in a switch of fast bowlers. Steyn is being managed carefully while recovering from a thigh strain.
Pakistan opted to strengthen their batting, with only four recognised bowlers in the side.
The injured fast bowler Umar Gul was missing as was his replacement, Shoaib Akhtar, who only arrived in South Africa Wednesday.
Mohammad Asif, Shahid Nazir and Naved-ul-Rana made up Pakistan's pace attack, backed by leg-spinner Danish Kaneria.