Simon Harmer took six wickets as Australia collapsed to 111 all out to hand South Africa a 176-run victory and a 2-1 series win at Newlands on Saturday.
Chasing 288 on the fifth and final day, Australia slumped to 60-7 at lunch after a devastating opening burst from Kagiso Rabada (3-14).
The pacer removed Matt Renshaw for a first-ball duck and Marnus Labuschagne for four in the first over, then claimed Travis Head for 14 for his 350th test wicket to leave Australia 22-3.
Harmer, who finished the innings with 6-16 and the match with 10 wickets, struck twice in an over as Alex Carey reverse-swept to Marco Jansen and Cooper Connolly edged behind, leaving the tourists 42-6.
A run out of Josh Inglis for four added to the chaos.
Cameron Green, 27, was Harmer’s first victim after lunch, bowled dancing down the pitch, before a defiant 45-run stand between Pat Cummins, 11, and Nathan Lyon, 33 not out, delayed the end.
Cummins was trapped lbw by Harmer before he bowled Josh Hazlewood to seal the victory.
Temba Bavuma’s side had set up the win on day four with centuries from Ryan Rickelton, 101, and Wiaan Mulder, 115, in a 154-run stand to post 387, after being 140-4 overnight.
South Africa now find themselves top of the ICC test rankings.