Australia need 592 runs to win the decisive third Test against South Africa after Hashim Amla and AB de Villiers scored centuries in Perth.
Amla hit 196 and De Villiers 169 as South Africa scored 569 in their second innings to lead by 631 on day three.
Australia pacemen Mitchell Starc (6-154) and Mitchell Johnson (4-110) took all 10 wickets between them.
The hosts, who closed on 40-0, will set a new record run chase if they win, surpassing West Indies’ 418-7 in 2003.
After the first two matches in Brisbane and Adelaide ended in draws, South Africa only need to draw the third in Ricky Ponting’s last Test to ensure they remain the world’s number one side.
But with two days left they will now push for victory to become the first team since the West Indies in the 1980s and early 1990s to win consecutive series in Australia.
Australia were on the receiving end of the all-time world record defeat at St John’s in the Caribbean, however, the fact that openers Ed Cowan and David Warner safely negotiated the final 13 overs of the day on a flat pitch will buoy the hosts, who were earlier hit to all corners of the Waca.
Having resumed on 99, it did not take long for Amla to pass 100 for the 18th time in Test cricket. He shared a stand of 178 with captain Graeme Smith on the second day and followed that up with an 81-run partnership with Jacques Kallis (37) and 149 with De Villiers.
The 29-year-old was eventually caught and bowled by Johnson, four short of the third double ton of his career, before Dean Elgar suffered the ignominy of completing a pair of ducks on debut.
De Villiers, who reached his 14th Test hundred and first as a wicketkeeper with three successive reverse sweeps for boundaries off the bowling of off-spinner Nathan Lyon (0-128), took up the lead. The 28-year-old hit 21 fours and three sixes for his 169 off 184 balls, before he was caught behind off Starc.
Both Starc, who took the final four wickets, and Johnson deserve credit for restricting South Africa to just 133 runs for their final five wickets.