Temba Bavuma was stranded five runs short of a century as South Africa were all out for 488 on the second day of the fourth Test at the Wanderers Stadium on Saturday.
Bavuma was on 95, within sight of his second Test century, when Australian fast bowler Pat Cummins took two wickets with successive balls to finish off South Africa's first innings.
Cummins was easily Australia's most impressive bowler, finishing with five for 83.
On a pitch with pace and some uneven bounce, South Africa's total took them a long way towards their goal of securing a first home series win against Australia since 1969-70. South Africa lead the series 2-1.
The Australians, rocked by a ball tampering scandal during the third Test and missing injured strike bowler Mitchell Starc, endured a frustrating first half of the day as Bavuma shared stands of 85 with Quinton de Kock (39) and 66 with Keshav Maharaj, who hit a cavalier career-best 45 off 51 balls.
There were six partnerships of 50 or more in the South African innings.
More From This Section
Resuming at 313 for six on a dark, gloomy morning, Bavuma and De Kock had to weather some challenging bowling from Cummins and Chadd Sayers, armed with a ball which was only eight overs old at the start of play. The floodlights were switched on after only ten minutes, although they were switched off at lunchtime as the weather brightened.
Bavuma scored only four runs off the first 49 balls he faced on Saturday but then added another 21 runs off 21 balls to reach his fifty off 120 deliveries. He went on to face 194 balls in an innings which included 13 fours.
Last batsman Morne Morkel, playing in his last Test, was applauded to the wicket by the Australians but was out first ball, caught at second slip off Cummins.