Just over a week ago, Australia were bowled out for 47. It was an indignity that had not been suffered by men in the baggy green in more than a century. They lost the Cape Town Test before lunch on the third afternoon. The bright future that beckoned Michael Clarke's side after their series victory in Sri Lanka seemed to have been extinguished. It was standing-room only in the last-chance saloon.

Early on Sunday, things didn't look much better. Australia trailed by 209 and South Africa had seven wickets in hand. At 1-0 up, they could bat like Bill Lawry and still take the series. In a previous era, Shane Warne or Glenn McGrath might have taken the ball and forced the match in a different direction. In more recent times, winning from such a poor position has been next to impossible.

Few spectators expected a gettable chase. But a six-wicket haul from the teenager Pat Cummins set up a target of 310, and half-centuries from the under-pressure Ricky Ponting and Brad Haddin, as well as the rookie Usman Khawaja, set up Australia's win. Mitchell Johnson, whose bowling has been poor and makes him no certainty for the first Test of the home summer against New Zealand, got Australia home along with Cummins.

Last week, Clarke bemoaned a loss that was as painful as any he had experienced. The contrast could hardly have been more apparent after Australia's two-wicket win, the highest successful chase ever achieved at the Wanderers, and a victory that concluded in fading light late on the fifth afternoon.

"I didn't score many runs in this Test match but it feels like I just got my first double hundred for Australia, I couldn't be happier," Clarke said. "This is one of my greatest Test matches, no doubt. A big part of that is the way we got beaten in Cape Town. To be able to fight back and the rollercoaster throughout the Tests, the light, the weather, the chasing, the record last-innings total, for so many reasons it's one of my most special Test matches and I'll remember it for a long time."

Winning from any position was a hallmark of the great Australia sides of the past. Clarke's side is not great, but this victory will give them confidence. Young men like Cummins, Khawaja, Phillip Hughes and Nathan Lyon might just begin to believe that they are never beaten. The challenge is not to fall backwards.

Late in 2008, Graeme Smith's side chased down 414 at the WACA to beat Australia, and although they won the series, within four months they had lost to Australia at home as their self-belief waned. Australia's next series is against New Zealand, and that will be followed by a tough four-Test battle against India.

"To be able to fight back and the rollercoaster throughout the Tests, the light, the weather, the chasing, the record last-innings total, for so many reasons it's one of my most special Test matches."

"I think it will certainly help, we will continue to grow in confidence," Clarke said. "I said after Sri Lanka we would bring confidence into this series because of our success there and I hope we do the same; take momentum into the Australian summer. There will be some challenges that lie ahead and we've already seen that in Sri Lanka and on this tour, but we're getting better."

Not that it wasn't a nervous time for Australia as the chase came down to the wire. Clarke was bowled early on the final day, the victim of a fine ball from Vernon Philander, but also through a significant gap between bat and pad. When Ponting fell for 62, Australia still needed 145 runs with five wickets in hand. Clarke had been nervous the previous day; he was even jumpier on Monday.

"I started counting the runs down from 190 [required] yesterday," Clarke said. "I was next in the batting, I was walking back and forth while the boys were batting, they would get a single and I would say '189 more of those, Huss', '188 more of those, Huss'. When I came here today I thought we were in a really good position. I thought the way Usman and Ricky batted the night before was outstanding.

"They played really positive cricket so I was confident we could win the game today. I would have liked Ricky and I to have spent more time out in the middle but that's the way it goes. A lot of credit goes to our middle order batting in tough overcast conditions with a bit of rain around. We managed to hang in there and the youngster [Cummins] decided as he did in the one-day series to finish it off with ease."

As a result, Australia will fly home without having lost the series in any format on this trip. It is an outcome that has left Clarke proud and buoyant. "We drew the Twenty20 series, we've won the one-day series and now we have drawn the Test series against a fantastic opposition in their own backyard," he said. "We should be so proud of that. That's an amazing performance by Australian cricket in my opinion."