Aided greatly by Usman Khawaja, Ricky Ponting summoned his deepest reserves of skill and focus to give Australia a fighting chance of chasing 310 to square the two-match series against South Africa.
Ponting's 122-run union with the sure-handed Khawaja, who was out to Imran Tahir only one ball before the close, took the tourists to 142 for 3, leaving the match and series deliciously poised with one day remaining.
In an innings critical to his career and perhaps the manner of its conclusion, Ponting presented the straightest bat he has managed in quite some time to make a first Test half-century since the opening Test of the Ashes series last December. The captain Michael Clarke will accompany Ponting on the final morning.
Dale Steyn's bold striking meant the tourists required the highest fourth innings target to win a Test at the Wanderers, despite a stirring six-wicket haul on debut for the 18-year-old Pat Cummins.
Shane Watson and Phillip Hughes failed to repeat their first innings displays, both out to Vernon Philander with only 19 scored, but Ponting and Khawaja dulled the home side's offensive.
Without Steyn's 41, speckled with three sixes, Australia might easily have been chasing a target as thin as 250, after the hosts lost 4 for 29 in the morning to be 266 for 7. Cummins' remarkable efforts, adding up to one of the most outstanding debuts by an Australia fast bowler in the past 40 years, prevented South Africa from making the game entirely safe.
Hashim Amla went on to a deserved 105 from his overnight 89, but was involved in a run-out to account for Ashwell Prince and then became Mitchell Johnson's third wicket of the series. Nathan Lyon delivered another useful spell, only to be denied the wicket of Steyn via the vagaries of the DRS.
Australia's openers added 174 in the first innings, but in the second Watson allowed Philander to crash a straight delivery into the off stump second ball, and after a pair of boundaries Hughes sparred at the same bowler to present a catch to Jacques Kallis in the slips.
Khawaja had begun with a pair of wonderfully crisp boundaries in Philander's first over and Ponting, the eyes of the cricket world upon him in the manner of Mark Taylor at Edgbaston in 1997 or Steve Waugh at Sydney in 2003, eluded the early shuffle and lbw that had confounded him so far on this tour. Though he was beaten by the odd seaming, prancing delivery, twice Ponting swivelled into the pull shots of his pomp. Khawaja proved equally adept with a horizontal bat, and Australia's 50 was raised before tea.
Play resumed in bright sunshine, and Ponting made hay in the company of Khawaja to frustrate the diligent efforts of South Africa's bowlers. Slowly, but increasingly surely, they met the challenge of each bowler, be it Steyn's pace, Philander's line or Morne Morkel's bounce. Tahir's introduction had Ponting scampering down the wicket almost every ball, and overthrows gifted Khawaja a first half-century in his fourth Test.
Steyn was straining every sinew in search of a wicket, but Khawaja in particular was able to pick him off for runs, and one hook sailed over the head of fine leg for a splendid six. There were the vaguest signs of fatigue or discomfort from Steyn, in a match that has tested the stamina of bowlers on both sides.
The stand was worth 122 and Khawaja 65 when Tahir switched to over the wicket against Australia's No. 3. A natural against pace, Khawaja is still learning to read spin, and he prodded uncertainly forward to edge a googly to slip. Clarke only had time to face one ball, pushed for a single, before the umpires tramped off for bad light and eventually stumps.
The tourists had needed a rush of wickets on the fourth morning, and Clarke started off with Cummins and Johnson in search of it. Swinging the old ball prodigiously at times, Cummins maintained his rapid progress when he coaxed de Villiers into chasing one that curled away. Clarke held the catch and dared to hope.
Amla completed a century of formidable composure, cuffing Peter Siddle through point to get there, but his insistence on a short single to the right hand of Ponting resulted in a mix-up with Prince and the left-hander's exit. Johnson, still somewhat out of sorts, was able to produce a handy cutter to touch Amal's outside edge on the way through to Brad Haddin, and suddenly Australia's position was arguably the one preferred by neutrals.
Mark Boucher swatted three boundaries before driving at Lyon and snicking to slip. He loitered at the crease partly because he also hit the ground but also out of recognition that not much batting remained after him. Steyn had made only five and the lead was only 246 when he was beaten by a Lyon off break and so very nearly lbw. But the umpire Billy Bowden demurred, suspecting an inside edge, and Australia's referral was refused, not for an inside edge but because the ball's projected path was not hitting enough of leg stump.
This episode felt more damaging in the ensuing overs, as Steyn demonstrated the knack for nuisance batting he had famously shown with JP Duminy at the MCG in 2008, and Philander played with the level of skill befitting a No. 8. Clarke tried Michael Hussey before reverting belatedly to the second new ball.
Nearing lunch Steyn swung hard at Johnson and edged through the hands of Clarke, and Siddle moved the ball too much to claim the outside edge the tourists desperately required.
Having rested up in the latter part of the morning session, Cummins produced a snorter first ball after lunch to clip the glove of Philander. Bowden hesitated before giving Philander out, but the batsman's decision referral found just enough circumstantial evidence to ensure the original call was upheld. Next ball Cummins whirred down a yorker to wreck the stumps of Morne Morkel, thus claiming five wickets, and Imran Tahir did well to keep out a hat-trick ball that tailed away.
By surviving the over Tahir allowed Steyn to keep blazing, who lustily struck sixes off Siddle and Cummins, plus a glove down the legside, added precious runs. Tahir managed one boundary himself, but Steyn eventually touched Cummins behind to conclude yet another beguiling passage in this all-too-short series.