An unbeaten century stand between Hashim Amla and AB de Villiers put South Africa in control of the second Test as they opened up a 199-run lead with seven wickets in hand after the third day on Saturday.
Amla and De Villiers came together during dark times for South Africa, with the loss of their leading run-scorer Jacques Kallis 10 minutes before lunch leaving them on 90 for three in their second innings.
However, the duo dented Australia's hopes of levelling the two-test series by adding 139 for the unbroken fourth wicket, steering South Africa to 229 for three when bad light and rain ended play over an hour before the scheduled close.
Amla was on 89 not out and De Villiers on 70.
Amla and De Villiers survived some scares straight after lunch, with Amla coming closest to being dismissed when fast bowler Pat Cummins struck him on the pad in the first over of the second session.
Australia reviewed umpire Billy Bowden's not-out decision and Amla survived because the referral showed the ball was clipping the bails, creating enough doubt for the on-field umpire's decision to stand.
De Villiers's strokeplay was the more daring of the two as he collected 10 fours and a six off 122 deliveries. Amla hit a series of elegant cover drives and stroked 13 fours, seven of them through the off side, from 196 balls.
Eighteen-year-old debutant Cummins had claimed the key wicket of Kallis to rock South Africa just before lunch.
South Africa had stuttered to 94 for three at lunch as Cummins removed Kallis (2) and opener Jacques Rudolph (24) to go into the break with two for 27 in nine overs.
Kallis, who became just the fourth man to score 12,000 test runs in the first innings, prodded at a fine delivery that moved away outside off stump, finding the edge of his bat and giving Australia captain Michael Clarke an easy catch at first slip.
Rudolph, playing his second test since his return to the team after a five-year absence, scored his 24 runs off just 23 balls,but then lost his wicket. Brief scores: South Africa 266 & 229-3 (H Amla 89no, AB de Villiers 70 no) v Australia 296