(CNN) -- An unbroken 164-run partnership between Jacques Kallis and AB de Villiers kept alive South Africa's slim hopes of saving the second Test against Australia after they reached stumps on day four in Durban on 244 for two.
Kallis is 16 runs away from his century as South Africa battle to avoid defeat in the second Test in Durban.
The home side, who are chasing an improbable 546 for victory, lost openers Neil McKenzie and Hashim Amla before tea, with an inspired Peter Siddle doing the damage, but the intact third-wicket stand saw no damage done in the final session and left them with a realistic hopes of keeping the series alive.
There is also still an outside chance of the hosts winning the game with the target having now been reduced to 302 but there is no doubt Kallis, not out on 84, and De Villiers (68) will have their initial thoughts on batting the team to safety.
South Africa began the chase confidently enough, reaching lunch at 35 without loss after visiting captain Ricky Ponting had declared Australia's second innings at 331 for five.
McKenzie and Amla, who was shifted one place up the order following captain Graeme Smith's broken finger, reached their 50-partnership before the former was out for 31.
A good ball from Siddle bowled just on the line of off stump nipped back and left the opener uncertain as he edged behind to Brad Haddin, ending a 63-run stand.
And the very next delivery, Kallis was enticed into playing at an away swinger that was edged to Marcus North, who reacted late and failed to hang on at first slip.
But Siddle was rewarded for his fine spell of bowling when Amla lost his concentration and chased a wide delivery that was snapped up by Ponting at second slip for 43.
But De Villiers and Kallis held firm and brought up the 50 stand off only 71 balls to leave their team 145 for two at tea -- and they continued to build on that momentum, going through the final session without losing any further wickets.
The century stand was brought up in the 59th over, before Kallis reached his 50 when he squeezed Mitchell Johnson through the covers for two. That was followed by De Villiers' half-century from 106 balls as the pair looked comfortable against a tiring Australian attack and took their partnership through to the close.
Earlier, the hosts were set the daunting chase after Ponting's declaration came just under eight overs into the day.
However, it did not stop Phillip Hughes from crossing the 150 mark as he continued to pile on the misery for the hosts, before eventually being dismissed by Makhaya Ntini for 160.