Cape Town: Graeme Smith was out for three in his last Test innings as South Africa struggled to 71 for four while chasing 511 to win on the fourth day of the third and final Test on Tuesday.
South Africa were 15 for three at tea before steadying the ship in the final session of the day at Newlands as they fought to reach an unlikely target in this deciding match of the series.
Hashim Amla and AB de Villiers defied the bowlers for more than two hours in a fourth-wicket stand of 53 before Amla was leg before wicket to James Pattinson 20 minutes before the close.
Earlier, Australia's declaration at 303 for five was set up by a dashing second century of the match by David Warner.
There were a potential 144 overs remaining after the declaration, leaving South Africa needing to fight an extended rearguard action in order to avoid defeat in captain Smith's last Test.
Smith was given a guard of honour by the Australian players but soon lost Alviro Petersen, his opening partner, who was leg before wicket to Ryan Harris - the 100th Test wicket for the fast bowler.
Six balls later Smith fell for the fourth time in the series to Mitchell Johnson, edging a lifting delivery onto his thigh pad, with the ball looping to short leg Alex Doolan for an easy catch.
The Australians stood to salute Smith as he left the ground and his teammates gathered on the pavilion steps to applaud him off.
It ended a poor last series for Smith, who scored only 45 runs at an average of 7.50 in the three matches. He finished his 117-Test career with 9,265 runs at an average of 48.25.
He hit 27 centuries and 38 half-centuries and was captain in a world record 109 Tests.
Dean Elgar was then bowled by Johnson with what proved to be the last ball before tea.
Smith announced on Monday that he was retiring from international cricket after this match, but his last stint as captain in the field was an ignominious one as at times he had nine fielders on the boundary in a futile effort to stop the flow of runs.
Warner followed up his first innings 135 with 145, made off 124 balls. His last 45 runs were scored off 32 balls before he edged Kyle Abbott to wicketkeeper De Villiers going for another big shot. He hit 13 fours and four sixes.
When Warner was on 79 he reached 1000 runs in eight Test matches during the southern hemisphere season. The left-handed opening batsman finished the three-match series with 543 runs at an average of 90.50, hitting three centuries and two fifties.
Smith was applauded on to the field by his teammates, the Australian batsmen and a sparse crowd at the start of the day. But the only other highlight for him during the morning was the run-out of Chris Rogers.
Rogers fell for 39 to a direct hit from fine leg by Dale Steyn after an opening stand of 123 with Warner in just 20.2 overs.
Warner was in sparkling form and reached his fifty off 41 balls with six fours and a six over long-on off off-spinner JP Duminy.
Warner and Doolan consolidated with a second-wicket stand of 65 before Shane Watson and Steve Smith scored at better than a run a ball either side of Clarke's dismissal for a first-ball duck, driving to mid-off.
After the early flurry of wickets, Amla and De Villiers settled for resolute defence as South Africa sought to emulate their great escape in Adelaide in 2012/13 when they batted out 148 overs to earn an unlikely draw, having gone into the last day with four wickets down.
Amla made his 41 off 109 balls as the pair batted together for 30.4 overs before Pattinson struck with what appeared to be reverse swing.
De Villiers faced 100 balls in scoring 16 runs.
Australia 494 for 7 dec (Clarke 161*, Warner 135, Smith 84, Duminy 4-73) and 303 for 5 dec (Warner 145)
South Africa 287 (du Plessis 67, Petersen 53, Johnson 4-42) and 71 for 4
Status South Africa need 440 runs to win