South Africa 488 (Markram 152, Bavuma 95, Cummins 5-93, Lyon 3-182) and 134 for 3 (Elgar 39*) lead Australia 221 (Paine 62, Khawaja 53, Cummins 50, Philander 3-30) by 401 runs
Johannesburg: Australia all out for 221 to trail South Africa by 267 runs on first innings, South Africa bat again to lead by 401 at the end of third day.
A recovery of sorts saw Australia reach 221 all out having resumed on 110/6 at the start of the third day, thanks primarily to newly appointed captain, Tim Paine, who battled a broken thumb to top score with 62. Even with those runs Australia were still in real trouble.
Following on from his 152 in the first innings, Markram looked in form again with some sumptuous drives before he edged Australian seamer Pat Cummins to Peter Handscomb at second slip to depart for 37.
Markram, 23, playing just his 18th test innings, is the leading run-scorer in the series with 480 at an average of 60, and also went past 1,000 runs in the five day game, the second fastest to reach that mark for South Africa behind Graeme Smith (17 innings).
Nathan Lyon was getting the ball to grip and turn, but it was doing so quite slowly and the batsmen were able to turn him into the leg side for runs with relative ease. It was when Lyon got one to bounce more than Hashim Amla expected that it brought him a wicket as South Africa's No.3 edged to Mitchell Marsh at leg slip.
Cummins had his second when he got a ball to bounce alarmingly and AB de Villiers edged it through to Paine for 6 (5).
South Africa had earlier bowled Australia out for 221 in their first innings with a rush of wickets after lunch having been frustrated in the morning session by Tim Paine (62) and Cummins (50), who put on 99 for the seventh wicket.
New Australia captain Paine batted bravely with a stress fracture on his thumb to score a valuable half-century, his fourth in test cricket, but was the last man out as Elgar took a brilliant running catch at mid-off off Kagiso Rabada (3-53).
Cummins was the only wicket to fall in the morning session when he was trapped leg before wicket by spinner Keshav Maharaj (3-92), but South Africa ran through the tail after lunch, to pick up the last three wickets for the addition of 20 runs.
The home side have a fitness worry as seamer Morne Morkel, playing in his final test before retirement from international cricket, was forced from the field with a left side strain, but he did return to the pitch after the interval.