Set 158 for victory, South Africa reached their target with four balls to spare as Miller blasted his highest score in the format off 35 deliveries and rescued the home side’s flagging chase.
After winning the toss and electing to bat, Australia made a rollicking start and were 69 for one after six overs, thanks largely to Aaron Finch’s 40 from 18 balls.
But once the powerplay was over and South Africa got leg-spinner Imran Tahir into the game, the pace slowed and wickets started tumbling.
Australia managed only 88 for eight from the next 14 overs as Tahir (3-21) and David Wiese (2-16) did an excellent job in restricting the tourists.
If it were not for Mitchell Marsh’s fine 35 from 25 balls, the home side would have been chasing considerably less.
South Africa’s reply could not have got off to a worse start as AB de Villiers was out first ball trying to guide a Nathan Coulter-Nile delivery to third man but only succeeding in picking out wicketkeeper Peter Nevill.
When they slipped to 95-6 one ball shy of 13 overs, the touring side were favourites, but Miller constructed an innings that was a mix of power, timing and composure to see his side home.
Australia handed a debut to leg-spinner Adam Zampa, who recorded figures of 0-26 in his four overs.
The teams are using the series as a warmup for the World Twenty20 that starts in India on Tuesday.
The second of three matches will be played in Johannesburg on Sunday.