Cape Town: Dean Elgar hit a career-best 129 to guide South Africa through a demanding first day of the second Test against Sri Lanka at Newlands on Monday.
Elgar's century allowed the home side to reach stumps on a solid 6-297 after it had lost the toss and been asked to bat on an overcast and muggy morning that offered plenty of assistance to Sri Lanka's seamers.
The left-hander remained steadfast against the swinging ball early on, before scoring more freely when the sun came out later in the day and the pitch improved.
Although Elgar lost opening partner Stephen Cook to the fourth ball of the day, he shared in a 66-run stand for the second wicket with Hashim Amla (29), then added 76 with captain Faf du Plessis (38) for the fourth wicket.
While Amla was bowled by a quick delivery from teenage fast bowler Lahiru Kumara, who dismissed JP Duminy for a duck in the same over, Du Plessis was guilty of throwing his wicket away shortly before tea.
The South African captain had already been dropped off the bowling of Rangana Herath when he played an expansive drive at a turning delivery and was caught at slip.
When Temba Bavuma (10) was done for pace by Kumara's bouncer, South Africa was 5-169 and in danger of being dismissed cheaply.
But Elgar's durability held the innings together, and allowed Quinton de Kock to play his natural game in an unbeaten knock of 68.
De Kock scored at close to a run-a-ball in the early stages of his innings, and the pair went on to record a partnership of 103 in less than 24 overs that helped South Africa score more runs in the final session than in the first two combined.
Elgar went to his sixth Test century, before eventually falling to the second new ball when a tired stroke saw him caught behind off the bowling of Suranga Lakmal.
De Kock continued his assault to put South Africa, which leads the three-match series 1-0, in a strong position.
Brief scores
South Africa - 297 for 6 (Elgar 129, de Kock 68*, Kumara 3-86)