Johannesburg: To chase 612, Australia reach stumps on 88/3, needing to bat out the entirety of day five to save the fourth Test in Johannesburg on Monday.
Australia tried to batten down the hatches, but lost top their top three of Matt Renshaw, Usman Khawaja and Joe Burns to South Africa's depleted attack to finish the day on 88/3, need 524 to level series. They will need to pray for rain, or bat out day five to escape defeat and end the series with a draw.
Earlier, captain Faf du Plessis ended his run of low scores with a classy century, but fitness concerns over all three seamers made South Africa bat until tea before declaring.
South Africa finally called a close to their second innings on 344 for six, setting Australia a massive victory target of 612 runs.
But with Kagiso Rabada suffering from a stiff lower back, Morne Morkel struggling with a side strain and Vernon Philander nursing a groin problem, Du Plessis faces a juggling act with his potent seam attack.
South Africa need a draw to secure a first home series over Australia since 1970, with the tourists having been rocked by the ball-tampering scandal in which former captain Steve Smith, his deputy David Warner and batsman Cameron Bancroft were sent home after the third test in Cape Town.
Du Plessis (120) reached his eighth test century as he passed 50 for the first time in 11 innings, seven of which have been single-figure scores, including a golden duck in the first innings of this test.
His stylish innings ended when he edged seamer Pat Cummins (4-58) to a diving Peter Handscomb at second slip, also ending a fourth-wicket partnership of 170 with opener Dean Elgar (81).
Elgar’s 250-ball vigil ended shortly afterwards when he tried to attack spinner Nathan Lyon (2-116), but skied his shot to Shaun Marsh at mid-on.
Quinton de Kock (four) was trapped lbw by Cummins, who recorded the best test match figures of his career, 9-141.
Temba Bavuma (35) and Philander (33) shared an unbeaten stand of 71 for the seventh wicket before the declaration.