Australia have closed to within two wickets of victory over Pakistan in their first Test meeting, but Asad Shafiq ensured that a fifth day will be required.
The tourists are chasing down a record 490 for victory in the day-night clash, ending Sunday's session at the Gabba on 382-8 in their second innings.
Shafiq's score of 100* gives Pakistan the slimmest of hopes, with Azhar Ali (71) and Younis Khan (65) each making half-centuries before being sent packing by Mitchell Starc and Nathan Lyon respectively.
That left the Men in Green lumbering on 165-4 and looking at a heavy defeat in Brisbane, but up stepped Shafiq with a 10th Test hundred and Mohammad Amir also made 48 in a strong seventh-wicket stand - eventually going to Jackson Bird - to just about keep the Test alive.