Skipper Smith and Amla shared in a thrilling 178-run stand for the second wicket at almost seven runs an over as the tourists took a stranglehold on the top ranking in Tests.
At stumps, South Africa were 230 for two in their second innings, representing an overall lead of 292 runs. Amla was on 99 from just 84 balls with his 18th Test century beckoning, while Jacques Kallis, dropped on three by Nathan Lyon off Mitchell Starc, was on 17.
The highest successful run chase at the WACA is South Africa's 414 for four in 2008.
Brief scores: SA 225 & 230/2 (Amla batting 99, Smith 84) vs Aus 163 (Wade 68; Steyn 4/40, Peterson 3/44).