Hashim Amla’s century and a sensible eighth-wicket stand for South Africa left Australia facing a tricky target on the fourth day of the second test at the Wanderers.
Amla scored 105, before bowlers Vernon Philander and Dale Steyn added 48 in an unbroken eighth-wicket partnership that took South Africa to 314 for seven in their second innings at lunch.
South Africa led by 284 in overcast conditions on a pitch that was starting to misbehave.
Amla resumed on his overnight score of 89 and went on to make his 14th century in his 53rd test in the 10th over of the morning as he wristily dabbed Peter Siddle through gully for his 14th four.
The over ended badly for South Africa, however, as Ashwell Prince was run out for two after both he and Amla hesitated over a quick single to Ricky Ponting on the off side.
Six overs earlier, the home side had lost the wicket of AB de Villiers for 73 after he drove loosely at a full, wide delivery from Pat Cummins and was caught by Australia captain Michael Clarke at second slip.
Amla’s five-and-a-half-hour innings ended when he edged a fine delivery from left-arm paceman Mitchell Johnson, which bounced and seamed across him, to wicketkeeper Brad Haddin.
Mark Boucher (13) was caught at slip driving at off-spinner Nathan Lyon, who was celebrating his 24th birthday, to leave South Africa on 266 for seven, a lead of 236.
Australia could not wrap up the innings, with Philander scoring 23 not out and Steyn 20 not out to add to South Africa’s lead.
Cummins was the most successful of the Australian bowlers with three for 65 in 26 overs, but the 18-year-old could not sustain his effort and was passed over by Clarke for the second new ball, which was taken nine overs before lunch.
Australia are 1-0 down in the series and have to win this test to avoid their first series defeat in South Africa since 1970.