Cape Town - South Africa lost two further wickets in the second session on day three of the third Test at Newlands on Saturday, but they remain in control.
At tea, the Proteas were 151/3, giving them a lead of 207 with seven second innings wickets remaining.
LIVE: SA v Australia - 3rd Test, Day 3
Aiden Markram batted beautifully for his 84 before he was out clipping one on the on side to Pat Cummins off Mitchell Starc.
That wicket came just before the tea break.
Earlier, Hashim Amla failed once again to convert a good start when he was out for 31, caught by Cameron Bancroft off Cummins.
The talking point of the session, though, was when cameras spotted Bancroft putting the ball in his pants and working on it with what seemed a foreign object.
It is a story that is certain to gather momentum as the Test progresses.
At the end of the second session, AB de Villiers (18*) and Faf du Plessis (0*) were at the crease.
Australia had resumed the day on 245/9, but they only lasted 13 minutes on the third morning before Josh Hazlewood (10) was the last man out.
Kagiso Rabada was the man to get the breakthrough when he had the Aussie seamer caught at slip by Amla.
With Australia 255 all out, the hosts started their second innings with a 56-run lead under cloudy Cape Town skies.
Markram was dropped by Usman Khawaja in the first over of the innings when he was on 0. The Australian number three was late to react and ended up attempting the catch with one hand. When he put it down, Markram was spared a pair in the match having been removed for 0 in the first innings as Mitchell Starc was denied.
Markram hit the very next ball for four with a crisp cover drive, and he was on his way.
Elgar, meanwhile, looked like he was picking up where he left off. Full of confidence, the left-hander had moved nicely along to 14 before he looked to drive a full delivery from Pat Cummins only to edge to Steve Smith at slip.