Skipper Faf du Plessis hit his eighth Test century as the Proteas piled on the runs leaving Australia an impossible task to save this Test and the series.
South Africa had failed in seven home series against Australia since being welcomed back to international cricket in 1991. This would be their first home win over Australia since 1970.
Australia had the last session to face and Morne Morkel burst through their top order to leave them at 88-3.
Australia 221 and 88 for 3 (Handscomb 23*, Shaun Marsh 7*) need 524 more runs to beat South Africa 488 and 344 for 6 (du Plessis 120, Elgar 81).