A defiant century from Francois du Plessis helped South Africa draw the second Test against Australia in Adelaide.
The Proteas had looked to be on course for defeat after they were left on the ropes at 77-4 overnight.
However du Plessis - along with AB de Villiers and Jacques Kallis - frustrated the Australian attack to bat out the final day.
Du Plessis finished on 110 not out, with the all-rounder needing 310 balls to bring up his century - only the fourth South African to achieve the feat on his debut.
Du Plessis, though, had to survive some close shouts, with two successful leg before appeals from Michael Clarke overturned via DRS review, while he was dropped by Matthew Wade off Ben Hilfenhaus.
South Africa had been set an improbable 430 for victory, however Du Plessis and de Villiers were in no mood to even consider chasing that target - with just 49 runs being scored in the morning session.
De Villiers was finally out for 33, with his total coming off 220 balls. Peter Siddle got the breakthrough with an off-cutter bowling the wicketkeeper.
Kallis joined du Plessis at the crease and the duo put on 99 for the sixth wicket to effectively take the game away from Australia.
Nathan Lyon gave the hosts hope when he removed Kallis for 46, a thin inside edge cannoning on to the pads and into the hands of Ed Cowan at short leg.
And that set up a thrilling finish - with Siddle returning to the attack to end Dale Steyn's 28-ball resistance for a duck and then Rory Kleinveldt for three.
Du Plessis, though, remained unmoved as South Africa reached 248-8 when play was called to a halt.