Adelaide: South Africa were dismissed for 388 to trail Australia by 162 runs in the first innings on the third day in the second Adelaide Test on Saturday.
Debutant Faf du Plessis was the last man out at tea with a fighting 78 while hamstrung Jacques Kallis batted in pain for 58 to help South Africa avoid the follow on as Australia took a grip on the match.
The world number one ranked Proteas appeared in little hope of passing the follow on of 351 runs when they were struggling at 250 for seven.
But a 93-run stand for the eighth wicket between Du Plessis and Kallis set the platform for South Africa to go past the follow on and take away the option of Australia sending the Proteas back into bat.
Du Plessis faced 159 balls and hit 13 boundaries and a six before he was caught by Michael Clarke at silly mid on off Ben Hilfenhaus.
Kallis, batting at number nine after spending most of Thursday's opening day off the field with a hamstring injury, scored a crucial half-century off 93 balls before he fell to a catch behind off left-arm spinner Clarke.
Australia sought a review after an appeal was turned down and replays showed that as Kallis was sweeping the ball struck his pad, then glove before popping in the air for wicketkeeper Matthew Wade.
Kallis clutched his tender right hamstring after ducking several testing Peter Siddle bouncers.
It was Australia's morning with pacemen Siddle and Hilfenhaus sharing four of the wickets, including the prized scalp of Proteas skipper Graeme Smith for 122.
But the Australians had problems of their own with paceman James Pattinson leaving the field for scans on a side strain and unlikely to bowl again for the rest of the game.
The Proteas went into the third day at 217 for two but quickly unravelled, losing three wickets in four overs.
Offspinner Nathan Lyon enticed Jacques Rudolph to drive only to be caught by Rob Quiney at short cover for 29 to give Australia an early breakthrough.
Siddle grabbed Smith's key wicket in the next over when the Proteas captain was caught behind by Matthew Wade for 122 off 244 balls.
Smith sought a referral and after a lengthy delay by the TV umpire the decision was upheld much to the Proteas skipper's disgust after the review's Hot Spot infra-red imaging system detected a faint edge.
Smith has proved a lucky charm with his tons for South Africa. The Proteas have not lost the match in the previous 25 Tests in which he has scored a century.
Fired-up Siddle struck again trapping AB de Villiers leg before wicket for one to leave South Africa in serious trouble at 240 for five.
Fast bowler Dale Steyn came out to bat at number seven instead of Kallis and lasted 15 balls before he was snapped up by Ricky Ponting at second slip off Hilfenhaus for one.
Hilfenhaus sent Rory Kleinveldt's off-stump cart-wheeling out of the ground for a duck, bringing Kallis finally into bat.