Ryan Rickelton hit his maiden ton for South Africa, but some impressive bowling from Lahiru Kumara ensured day one of the second Test versus Sri Lanka was an even affair.
South Africa reached stumps at 269-7, propelled by Rickelton's first century in eight red-ball appearances and a speedy 78 from captain Temba Bavuma.
The hosts were left teetering on 44-3 in the morning session after choosing to bat first, with Kumara trapping Aiden Markram (20) lbw for his 100th Test wicket, then dismissing Tristan Stubbs (4) four overs later.
Bavuma restored a sense of calm with his third successive half-century, but South Africa were rocking again at 186-5, Asitha Fernando having Bavuma caught for his second wicket of the day before Prabath Jayasuriya dismissed David Bedingham for six.
However, Rickelton and Kyle Verreynne put on 77 for South Africa's sixth wicket of the day, before Sri Lanka star Kumara ended the former's landmark outing when his outside edge found Pathum Nissanka, and Marco Jansen (5) was cleaned out by Vishwa Fernando with the final ball of the day.
Verreynne (48 not out) and Keshav Maharaj will now resume at the crease on day two, with Sri Lanka bidding to halt a three-match losing streak against the Proteas.
Data Debrief: Landmarks for Rickelton and Kumara
South Africa and Sri Lanka each had a player with something to celebrate on the opening day of the Gqeberha Test.
Rickelton's previous high score in Tests was a knock of 42 versus Bangladesh on the same ground in April 2022, but his watchful 101 off 205 deliveries – featuring 11 fours – dragged the hosts out of some early trouble.
Kumara was the man to end his time at the crease, having earlier reached a century of Test wickets. He became the ninth man to take 100 wickets for Sri Lanka in the format, with 87 of those coming away from home.