The South African cricketers under their new long term captain Hashim Amla made a strong start to their first test against Sri Lanka in Galle, but the home team fought back in the final session.
The tourists won the toss and opening batsman Dean Elgar with 103 led his side to 194 for 1 at tea, but Sri Lanka picked up four wickets in the final session, the Proteas ending the day on 268 for 5.
Quinton de Kock, unbeaten on 17, and nightwatchman Dale Steyn were at the crease when stumps were drawn.
Fast bowler Suranga Lakmal struck two decisive blows for Sri Lanka to bring his team back into the reckoning.
He first got rid of Elgar, who hit 11 fours and three sixes, when the batsman flashed at a wide delivery and edged a catch to wicketkeeper Dinesh Chandimal.
In the penultimate over of the day, Lakmal, with the second new ball which was taken after 85 overs, bowled out AB de Villiers for 21.
Spinners Rangana Herath and Dilruwan Perera toiled all day and picked up a wicket each in the final session.
The second and final Test is in Colombo next week.