(CNN) -- Debutant Pat Cummins was once again the hero for Australia as the tourists chased down a second-innings target of 310 on day five of the second Test against South Africa to ensure the series finished 1-1.
The 18-year-old had already become the youngest player to take five or more wickets on his Test debut with figures of 6-79 as South Africa reached 339 on Sunday, then he hit the winning boundary as the tourists survived a worrying collapse on Monday.
Man of the match Cummins was 13 not out while fellow fast bowler Mitchell Johnson hit an unbeaten 40 as the tourists made the highest fourth-innings total at Johannesburg's Wanderers Stadium with two wickets remaining.
Australia bounced back from losing the first match by eight wickets, having been dismissed for just 47 in the second innings in Cape Town.
"What an amazing series for all the supporters of Test cricket," Australia captain Michael Clarke said. "Some ups and downs through out the series, but it has been really exciting. I was yelling and carrying on like an absolute goose, but we were cheering every run.
"It is about now managing Cummins and making sure he becomes one of the all-time greats. We are working our backsides off and trying our best, but what a performance today."
South Africa captain Graeme Smith echoed Clarke's sentiments.
"The last few series we have played with Australia have been good adverts for Test cricket, and it was no different this time," Smith said.
"They played really well today. It is wonderful to see Test cricket played like this, but right now there is disappointment with the result."
Starting the final day on 142-3, needing 168 runs to level the series, the Australians slipped to 215-6 before Johnson and wicketkeeper Brad Haddin added a vital 72 runs.
Haddin hit 55 before being caught by wicketkeeper Mark Boucher off the bowling of Vernon Philander, with Peter Siddle dismissed for just four runs by spinner Imran Tahir.
Johnson and Cummins then steadied the ship to secure an unlikely win, although Dale Steyn dropped the teenager with Australia still nine runs short of victory.
Fresh from an eight-wicket haul in the first Test, man of the series Philander was once again in form as he took five second-innings wickets.
But the 26-year-old's efforts were in vain as Australia scrapped to an unlikely win.
"Mitchell asked me to keep a cool head, and I took that for swinging," Cummins said.
"Great to bowl them out yesterday, and to contribute was even better. I was looking up to Peter Siddle and Johnson throughout for support and they bowled beautifully."