However, Captain Temba Bavuma top-scored with 70 runs, and overcame a shaky start to be 28 overnight, then showed both patience and resilience on the second day to go to his 50 off 93 balls. He was back in the side after missing the two-test series victory in Bangladesh last month with an elbow injury.
After some lusty boundaries, he perished near the end of the innings, Reuters reported.
South Africa had resumed on 80-4 after rain limited play on the first day to only one session, and it took only 16 balls on Thursday for their first wicket of the second day to fall when Kyle Verreynne was trapped leg before wicket without adding to his score of nine.
Wiaan Mulder then retired hurt with a single run after facing seven balls, having been hit on a finger by a rising ball from Lahiru Kumara, but returned as the last batsman and finished nine not out.
Spinner Prabath Jayasuriya took two quick wickets with Marco Jansen lbw for 13 before Gerald Coetzee was caught in the outfield by a diving Kamindu Mendes, unable to resist the temptation of trying to hit the bowler out of the ground but not connecting properly.
Keshav Maharaj briefly took to the bowlers and scored a quick 24 off 35 balls to add some potentially vital runs to the home tally, but was always living dangerously and holed out to mid-off when Vishwa Fernando was brought back into the attack.
When Bavuma became the ninth wicket to fall, with the score on 165, the session was extended and the last wicket partnership added 26 runs before Kagiso Rabada was caught for 15 to end the innings.
Asitha Fernando and Lahiru Kumara took three wickets each on a pitch always expected to assist the seamers as Sri Lanka s decision to put their hosts into bat paid off.
South Africa and Sri Lanka are both chasing victory in the two-test series to keep on course for a place in next June’s World Test Championship final at Lord’s.