Australia's quest to move on from their ball-tampering scandal began with a late fightback after Aiden Markram's sensational 152 and AB de Villiers' typically brilliant knock had put South Africa in a strong position on day one of the fourth and final Test.

An ill-tempered series, which the hosts lead 2-1, made international headlines last week, when Cameron Bancroft was caught on camera attempting to alter the condition of the ball with what was later revealed to be sandpaper on day three of the third Test.

The very public fallout has already led to 12-month international and Australian domestic cricket bans for Steve Smith and David Warner, the former deemed to have had knowledge of a potential plot allegedly orchestrated by Warner and carried out by Bancroft, who was hit with a nine-month sanction. All three retain the right to an appeal.

Head coach Darren Lehmann also confirmed he is to step down after this Test in Johannesburg, and the backlash no doubt played a part in what began as a jaded bowling performance.

The brilliant Markram cashed in as the series' top run scorer constructed a brilliant innings for his fourth Test century, while De Villiers continued a fine run of form with a valuable 69.

But, to Australia's credit, they hit back in a final session that returned four wickets, with Pat Cummins (3-53) initially stemming the tide before Chadd Sayers – in for the injured Mitchell Starc – grabbing a couple of crucial late wickets as South Africa closed on 313-6.

South Africa made steady progress throughout the morning, although Dean Elgar's disjointed knock of 19 ended with a skewed lob off Nathan Lyon that Sayers took at mid-off.

Markram punished a tired-looking Australia attack, though, scoring particularly freely through point and playing a neat fine drive over mid-on from Lyon for six en route to passing fifty.

The in-form batsman continued as tormentor-in-chief in the afternoon, classily negotiating the pacemen and carefully seeing off Lyon's threat, with the majority of his runs coming square on each side of the pitch.

Hashim Amla (27) was dismissed by a Cummins outswinger that he edged to second slip where Peter Handscomb - taking Smith's number four slot - took a sensational diving catch.

But Markram brought up the ton and in the evening session, after De Villiers had given Lyon the workaround with two fours and a six, he accrued a maiden 150 in Test cricket - a drive for four through mid-off from Cummins taking him to the tally.

Cummins checked South Africa's momentum in the same over, though, finally taking the crucial wicket of Markram - who dabbed one to gully - before swinging one in to have Faf du Plessis (0) trapped lbw from the next ball.

De Villiers reached his fifty off just 94 balls but, when well set at the crease, the explosive batsman got the slightest edge behind to become Sayers' first Test victim

Shortly after, Kagiso Rabada (0) chipped Sayers to mid-off to give Australia more reason to celebrate, although the Proteas bowlers will be encouraged by the opportunities the pitch offered on day one.