Mitchell Johnson hit an 86-ball century for Australia before South Africa completed an innings and 20-run win on the fourth day of the third Test at Newlands on Sunday.
Johnson and Andrew McDonald (68) shared an Australian record seventh wicket stand of 163 to delay South Africa's consolation victory. Australia won the series 2-1. Left-arm spinner Paul Harris took six for 127 and fast bowler Dale Steyn three for 96.
South Africa were on course for a crushing victory when Australia lost their sixth wicket at 218, still 224 short of avoiding an innings defeat. But McDonald and Johnson, voted man of the series, went for their shots and thrashed a tiring bowling attack.
They put on 163 in 122 minutes off 161 balls to break the Australian seventh wicket record against South Africa of 160 by Richie Benaud and Graham McKenzie in 1963/64. The stand was ended when McDonald was caught at silly mid-off off Harris.
Johnson was on 95 while Peter Siddle was out first ball, also caught at silly mid-off.
Johnson, who was stranded on 96 not out in the first Test in Johannesburg, faced Steyn, who placed eight fielders on the boundary in an invitation to Johnson to take a single and expose new batsman Bryce McGain.
But Johnson pulled the second ball for six to raise a maiden Test century. In the same over Johnson called for a suicidal second run and McGain was run out at the bowler's end. Johnson finished on 123 not out off 103 balls with 11 fours and five sixes.
Only 40 runs were scored during the morning for the loss of Simon Katich's wicket but three wickets fell between lunch and tea before McDonald and Johnson came together. South Africa had to wait 98 minutes before Harris had Katich caught at mid-off after Katich and Mike Hussey dug in with cautious batting, adding just 36 runs from the start of play. Katich was out for 54, adding 10 runs in 60 balls before playing a loose drive.
He could have been out without adding to his overnight 44 when Harris put down a straightforward chance at gully off Steyn in the ninth over of the morning. Hussey was caught at gully off Steyn four overs after lunch for 39 and Brad Haddin became Harris' third victim when he holed out to mid-on.
Australian vice-captain Michael Clarke made a fighting 47 before he was bowled off an inside edge by Steyn, armed with the second new ball, shortly before tea.