Chasing 213 runs, Australia managed to reach 215/7 in 47.2 overs, in a highly tactical match.
Travis Head got a half-century for Australia, smacking 62 runs off 48 balls. Meanwhile, Steve Smith (30), David Warner (29) and Josh Inglis (28) also got key knocks for Australia.
For South Africa's bowling department, Tabraiz Shamsi and Gerald Coetzee took two wickets each.
Earlier, David Miller's 101 off 116 balls almost single-handedly took South Africa to a score of 212 after Australia piled on the pressure in the first 20 overs and sent back their top four within the first 12.
Mitchell Starc and Josh Hazlewood were relentless with their lines and lengths while the Australian fielders were flying around and stopping almost everything. It led to South Africa scoring just 22 runs in the first 11 overs.
Miller and Klaasen steadied the proceedings for the Proteas before they started counter-attacking and putting some pressure on the Australians. The stand reached 95 in 113 when Travis Head dismissed Klaasen on 47 off 48.
Miller fell soon thereafter on 101 off 116 balls and South Africa were all out for 212 in the final over.