Jean-Paul Duminy hit a superb unbeaten century to put South Africa in a position of strength on the second day of the first Test against Sri Lanka on Thursday.
The left-hander came in to bat with South Africa placed at a shaky 331-7 but he batted sensibly under pressure to help his side declare their first innings at 455-9.
In reply, Sri Lanka were 30-0 when stumps were drawn for the day with Kaushal Silva batting on eight and Upul Tharanga on 20.
Tharanga, playing his first Test in six years, showed little signs of nervousness, hitting four boundaries in his 40-ball innings so far.
The Sri Lankan bowlers were made to toil in hot and humid conditions by the gritty rival batsmen who dug in to ensure their team did not lose the advantage of winning the toss and batting first on a placid track at the Galle International Stadium.
It was Duminy (100 not out) who stole the show with a superb rearguard action after opener Dean Elgar had laid the foundation for a good total with a 103-run knock on day one.
Duminy, 30, frustrated the bowlers to take South Africa past the 400-run mark. His 206-ball effort contained 10 hits to the boundary including an exquisite cover drive off skipper Angelo Mathews.
Mathews had to give himself the ball in the absence of pace spearhead Shaminda Eranga who remained off the field with a split webbing in his bowling hand.
Duminy, dropped on 82 by Dilruwan Perera, was given a standing ovation from his mates in the dressing room after he completed his fourth Test century.