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 on the third day at the Wanderers 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-3 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. Both batsmen 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, stroking 13 fours, seven of them through the off side, from 196 deliveries.
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 both 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, stroking five beautiful boundaries, but then lost his wicket as he tried to pull Cummins but could only sky a catch to wicketkeeper Brad Haddin.
Cummins, who is playing just his fourth first-class match, belied his years as he bowled with both pace and accuracy, enjoying the extra bounce on offer from the Wanderers pitch.
South Africa, who resumed their second innings on nought without loss after facing just four balls on the second evening, made a good start as captain Graeme Smith and Rudolph added 40 for the first wicket.
Smith looked in fine form as he scored 36, but the left-hander then top-edged a cut at off-spinner Nathan Lyon and was caught by Phil Hughes at backward point.
Play was delayed for several minutes shortly before lunch as De Villiers was getting treatment for his foot after being struck by a rapid Cummins yorker.