South Africa 317 for 4 (Elgar 95, Markram 68, du Plessis 55*) trail Sri Lanka 396 (Chandimal 85, de Silva 79, Shanaka 66*, Sipamla 4-76, Mulder 3-69) by 79 runs
Centurion: Dean Elgar, Aiden Markram and Faf du Plessis all hit half-centuries against a depleted Sri Lankan bowling attack as the host nation fought back on the second day of the first Test at SuperSport Park, Centurion on Sunday.
Opener Elgar fell five short of a century by striking a confident 95 including 16 fours and shared in a fluent first wicket partnership of 141 with Markram, who marked his recall to the national team with 68 (94 balls, 14 fours).
Du Plessis, playing his first Test match since standing down as skipper, ended the day well with an unbeaten 55 (81 balls, 9 fours) - South Africa reaching stumps at 317/4. That left them trailing the tourists by 79 runs.
Debutant Luthu Sipamla making amends for a tough day one by finishing as the pick of the bowlers with four for 76, the Sri Lankans slipping from 340 for six overnight to 396 all out.
But it was tough going initially with the daring Dasun Shanaka (66*) proving difficult to dislodge. The all-rounder put on 67 with Kasun Rajitha (12) to leave the home side sweating, the total at stage leaving the islanders in the pound seat on 387 for six.
But Sipamla finally got the ball to talk late on, removing the last three wickets for the addition of nine runs, including claiming two wickets in two balls - Sri Lanka all out in 96 overs.
It was then over to South Africa's batsmen, who had struggled to get going in recent months. Not since their 2018/19 home series against Pakistan had they batted confidently and openers Markram and Elgar revived those fond old memories with a bold opening stand that lasted 28.4 overs.
However, it ended with a loose drive-by Markram off Vishwa Fernando that flew straight to backward point.
Rassie van der Dussen managed just 15 in a stand of 59 with Elgar before both men fell with the total on 200.
Twenty runs later and a fine Wanindu Hasaranga delivery on debut sent captain Quinton de Kock (18) on his way, the bowler earning his maiden Test wicket in the process.
But Du Plessis and Temba Bavuma (41 not out) added an unbroken 97 together for the fifth wicket to maintain the momentum and leave their side well-placed heading into day three.