Michael Clarke produced his third double-century this year and reached 1,000 runs for 2012 with a defiant unbeaten 218 on Monday, continuing his exemplary batting form since taking over as Australia captain and guiding the hosts to a first-innings lead against top-ranked South Africa.
Clarke posted his 20th career test century and his sixth since replacing Ricky Ponting as skipper last year as he guided Australia to 487-4 in reply to South Africa's 450.
After going to the crease with Australia in trouble at 40-3 late Sunday, Clarke shared a record 259-run, fourth-wicket partnership with opener Ed Cowan - who posted his maiden test hundred before he was run out for 136 - and an unbeaten 188-run fifth-wicket stand with Mike Hussey, who was not out 86 at stumps on the fourth day.
After being in such a precarious situation on day three, the Australians are now chasing an unlikely victory. They'll need to establish a decent lead on the last day, then try to bowl South Africa out quickly.
"I know it's going to be tough winning the match from here, but we're going to have a crack," Clarke said as he left the field.
He is the leading run-scorer in test cricket in 2012, reaching the 1,000 mark when he moved to 218 in the next to last over - at that moment, his average in seven tests for the year was 111.11 in a span that includes a triple century and a double century against India.
Until he smashed his career-high 329 not out against India in January, his highest test score had been 168. Since then, he scored 210 in the same series against India and was averaging almost 60 in his 14 tests since being appointed captain in the wake of Australia's quarterfinal exit at the 2011 World Cup.
Clarke sprinkled 21 boundaries through his 350-ball stand and, apart from two loose shots immediately before and after he reached 50, was rarely troubled by the bowling attack rated as the best in the world.
Cowan stroked 17 boundaries and had a few chances before he was dismissed, out of his ground when fast bowler Dale Steyn got a hand to a full-blooded Clarke drive and deflected the ball onto the stumps at the non-striker's end just before the tea interval to make the Australian total 299-4.
It was the only wicket to fall on day four after Australia resumed on 111-3, making a mockery of predictions that the Gabba pitch would be fast and furious and be fruitful for the bowling attacks which combined featured five of the world's top nine pacemen.
Clarke joined opener Cowan late Sunday after Ponting was dismissed for a duck and their nearly six-hour stand became the country's highest fourth-wicket partnership in a test at the Gabba, surpassing the 245 by Mike Hussey and Clarke in 2007-2008 against Sri Lanka, and a record for that wicket against South Africa.
The Clarke-Hussey combination resumed after the tea break, plundering the tiring South Africa attack. Hussey hit 12 boundaries and faced only 109 balls for his 86 in a partnership that was generating a run a minute.
Cowan had a couple of chances, including one when he should have been run out on 106 after being sent back by Clarke when attempting a quick single and another on 123 when he hooked Rory Kleinveldt to deep fine leg, where Steyn and Jacques Rudolph got in the way of each other and put down a routine outfield catch.
Cowan hit 18 boundaries to prove he could convert a good start into a century and gave Clarke a gesture to signal no hard feelings when he was finally run out after 388 minutes at the crease.
The 30-year-old lefthander had a couple of anxious moments, including an inside edge for four in his 50s and a top-edged hook to move to 98.
Cowan's place in the test lineup was under scrutiny coming into the series, but his assured innings - particularly after the failures of David Warner (4), Rob Quiney (9) and former captain Ricky Ponting (0) on Sunday evening - will help secure his spot at the top of the order.
His previous high score in seven tests was 74 against India in January, one of his three test half centuries.