Australia were reduced to 111 for three in reply to South Africa's 450 all out on day three of the first Test at the Gabba in Brisbane on Sunday.
Australia's hope of saving the game rest with Ed Cowan and skipper Michael Clarke after the tourists kept their grip on the rain-hit contest.
With the second day having been washed out South Africa were finally out for 450 with most of the credit going to centuries from Jacques Kallis and Hashim Amla.
Amla scored 104 before he was out in the morning session and Kallis went on to score 147 with good support from AB de Villiers (40) before James Pattinson claimed both wickets in a return of three for 93.
The home side then lost opener David Warner and Test debutant Rob Quiney for single figures before former captain Ricky Ponting went for a duck to leave them struggling on 40 for three.
That brought together Cowan and Clarke and they played confidently to see Australia through to 111 without further loss at the close.
Cowan finished the day one short of his half-century and received a reprieve when South Africa thought he had edged a Morne Morkel delivery into the gloves of De Villiers off the third ball of the penultimate over.
Umpire Asad Rauf was unmoved by South African appeals and when the tourists decided to review the decision it was shown Morkel stepped marginally over the line and a no ball was called.
Cowan, on 47, appeared to have gloved the ball but his reprieve meant he was able to help Clarke steer the home side to the close without further loss.
Earlier James Pattinson had led the comeback as Australia claimed wickets late in the day to slow down South Africa's charge.
After Amla fell to Peter Siddle in the morning session, Pattinson claimed the wickets of Kallis and De Villiers, removing the two men who were forming what had looked like a dangerous partnership.
Thereafter South Africa got bogged down when they should have been looking to add quick runs to make up for the loss of time on day two - and two further wickets fell before tea.
After a full day under the covers in the Brisbane rain, the pitch looked green upon resumption and Amla was suitably circumspect in knocking off the 10 runs he needed for his ton.
On 99, he received a short ball from Pattinson and cut it to the boundary, but shortly after reaching the milestone he was trapped lbw by Siddle, ending the partnership on 165.
Replays suggested Amla should have called for a review, though, as the ball was going over.
In the next over Kallis took two off Ben Hilfenhaus to register his 44th Test century.
De Villiers had some uncomfortable moments early on, including an edge off Siddle that went for four, but as time went on the pitch looked to flatten out and by lunch the pair had taken their partnership to 73.
It looked like being more of the same after the resumption when De Villiers clipped Pattinson for four and Kallis drove Nathan Lyon to the boundary.
But in the fourth over after lunch Kallis edged a cut shot to gully where Quiney took a good catch to end a stand of 90.
And two overs later, De Villiers fell in similar fashion, Warner on hand this time to pouch an awkward catch at point.
With JP Duminy absent after rupturing a tendon in the warm-down on day one, South Africa were suddenly looking vulnerable as Jacques Rudolph and Vernon Philander attempted to steady the ship.
Philander smashed Lyon for six but edged Siddle to slip soon after and Rudolph, who crept to 18 off his first 56 balls, sliced a drive off Lyon as he finally accelerated to give Quiney his second catch, falling for 31.
That left Dale Steyn (15 not out), who earlier successfully appealed an lbw decision via DRS, as South Africa's best hope for adding quick runs after tea.
In fact it was Test debutant Rory Kleinveldt who scored the only runs after tea, most notably back-to-back sixes off Lyon, as Hilfenhaus removed Steyn and Morkel to bowl South Africa out for 450.
After a slow start to their reply Australia looked to Cowan and Clarke who had taken their partnership to 71 by stumps.