Pakistan's batsman Wahab Riaz (R) hugs Asad Shafiq for his century. ─ AFP
He shared partnerships of 47 with Sarfraz Ahmed (24), 92 with Mohammad Amir (48) and 66 with Wahab Riaz (30 ) to defy an Australian attack that was unable to replicate the dramatic spell in Pakistan's first innings that netted 7-24 with the pink ball under lights.
Compounding the frustrations for Australia were dropped catches, including two good chances at second slip by skipper Smith one off Mitch Starc's bowling when Shafiq was on 72.
Pakistan has set a record for the biggest fourth innings at the Gabba. England previously held the record with 370 in the 2006-07 Ashes series, but that was in a 277-run loss. Now Pakistan is hopeful of going one further.
The two highest successful fourth-innings chases in test history have come against Australia the West Indies scoring 418-7 at Antigua in 2002-03 and South Africa making 414-4 in Perth in 2008-09.
Pakistan resumed Sunday at 70-2 and survived the shortened first session without loss. But after a long delay for a thunder storm, and a 15-minute interruption for showers, Pakistan lost opener Azhar Ali (71), skipper Misbah-ul-Haq (5) and Younis before dinner.
Starc ended Azhar's defiant innings after a barrage of short-pitch bowling. The Pakistan opener was 41 overnight and hadn't added a run when he was hit on the back of the helmet by a short ball from Josh Hazlewood.
He shrugged off the pain to lead a 91-run stand with Younis before succumbing to the short ball, attempting a pull shot and giving a leg-side catch to Wade.
Younis appeared to be Pakistan's best hope of salvaging something from the contest but when he went out, Shafiq took up the challenge.
He had excellent support from Sarfraz, who was clean bowled by Starc's full, in-swinging ball to reach 220 with four wickets left.
Amir batted at No. 8 and surpassed his highest test score 39 not out before he was caught behind off Jackson Bird, ending a 66-ball, 86-minute cameo.
Wahab took over, hitting two sixes and two boundaries to continue the rearguard effort.
Australia set up the game by scoring 429 after winning the toss and then bowling Pakistan out for 142 on day three.
Smith opted not to enforce the follow-on, despite the 287-run lead, and declared later Saturday at 202-5, setting Pakistan an improbable target of 490.
Any hope for Pakistan rests with a rearguard action from Sarfraz and Shafiq, but the batsmen will certainly face nerve-shredding tests during the evening session when the pink ball is at its most lively.
In the first inning, Australia set a target of 429 runs for Pakistan. In the second inning, Pakistan tried to match it but only got to 142 all out in just 55 overs.
Play will begin 30 minutes early tomorrow, ESPN Cricinfo reported.