A fightback late in the day from Hashim Amla and AB de Villiers helped the Proteas to 71 for four, at stumps on day four of the third Test against Australia at Newlands, in Cape Town, on Tuesday.
It left Australia needing six more wickets to win the match and the series with a day remaining.
South Africa, meanwhile, would attempt to bat out the three remaining sessions unconcerned with the victory target of 511.
The Proteas lost three wickets in six overs before tea, including Graeme Smith in his final Test innings for three, but resolute defence from Amla (41 runs, 109 balls, four fours) and De Villiers (16 runs, 100 balls, one four) helped keep alive the hosts' slim hope of an unlikely draw.
Amla, however, was out with 20 minutes left in the day lbw to James Pattinson. It ended a 53 run stand from 185 balls between the pair of Amla and De Villeirs.
Night watchman Kyle Abbott came in and was unbeaten at the close of play along with De Villiers.
Before tea, first to fall was Alviro Petersen (9) out plumb lbw to Ryan Harris in the third over. Mitchell Johnson then accounted for both Smith (3) and Dean Elgar. Smith, clipped the ball to Alex Doolan at short leg as South Africa lost their second wicket with the score on 12. Johnson then clean bowled Elgar for a duck.
Declared
Earlier in the session, with the series level at 1-1, the visitors declared their second innings on 303 for five, leaving South Africa a day and a half to bat out.
David Warner smashed his second century of the game, scoring 145 (156 balls, 13 fours, four sixes) before he was caught behind off the bowling of Abbott.
Steve Smith (36) and Brad Haddin (3) were at the wicket when the visitors declared. Abbott took 3/61 dismissing Shane Watson for 25 and skipper Michael Clarke for a first-ball duck. He also took a catch to dismiss Doolan (37) after lunch off a Morne Morkel delivery.
Earlier, Chris Rogers was run out by Dale Steyn for 39, to end an opening stand of 123 runs with Warner, off just 124 balls.
Abbott came into the team for the injured Wayne Parnell and is playing in only his second Test. He made a remarkable debut for the Proteas against Pakistan in February 2013 where he took 7/29 in the first innings and produced match figures of 9/68. – Sapa