The joy of winning the toss here on Friday appeared short-lived for South African captain Ashwell Prince as the ball swung and bounced on the dry Sara Oval wicket, making life difficult for the batsmen.
The tourists were reduced to 31-3 by the eighth over before the situation was retrieved with a fluent 40 from Hashim Amla and defiant batting from Prince and A.B. de Villiers.
The duo have so far put on 43 for the unbroken fifth wicket with Prince unbeaten on 28 and de Villiers on 31 off 27 balls with six boundaries.
South Africa are seeking a series-levelling win after being thrashed by an innings and 153 runs in the first Test at the Sinhalese sports club.
Chaminda Vaas, returning for Sri Lanka after missing the first Test due to a hamstring injury, struck with the second delivery of the match by trapping out-of-form opener Herschelle Gibbs leg-before.
Gibbs, who made 19 and 18 in the first Test, failed to bring his bat down in time and was beaten by a ball that went straight through and rapped his left pad.
Makeshift opener Andrew Hall edged a drive off Lasith Malinga and was caught at third slip by Tillekeratne Dilshan for no score.
Left-handed Jacques Rudolph, who made 90 in the second innings of the first Test, managed only 13 when Malinga scattered his off-stump with an express delivery.
Amla, dropped by wicket-keeper Prasanna Jayawardene off Malinga before he had reached double figures, made amends with seven delightful boundaries before falling to Muttiah Muralitharan.
The off-spinner, who claimed 10 wickets in the first Test, deceived Amla in the air and trapped him leg-before on the back foot.
South Africa welcomed back veteran seamer Shaun Pollock, who opted out of the previous Test following the birth of his second daughter. Pollock replaced fast bowler Andre Nel.
English umpire Mark Benson, who was due to stand in the match, flew home after falling ill during the first Test and was replaced by Pakistan's Aleem Dar. Billy Bowden of New Zealand is the other umpire.