Pakistan made a recovery on the back of a composed, unbeaten century by Asad Shafiq as the team looks to chase down a daunting total of 490 runs in the first day-night Test against Australia in Brisbane.
Shafiq rallied Pakistan's resistance with a thrilling ton, frustrating Australia's push to wrap up victory on the penultimate day and keeping alive his own slim hopes of a record-breaking win in the series-opening day-night test.
The middle-order batsman raised his 10th test century in the second-to-last over of the day, reaching the milestone from 140 balls and stroking 10 boundaries and a six.
He was not out 100 at the close and Yasir Shah was on four, surviving three balls after Wahab was caught at slip in the last over.
After an extended, rain-interrupted fourth day, Pakistan reached stumps at 382/8. The team added 312 runs today and lost six wickets.
That left Australia three sessions Monday to take two wickets. Pakistan needs 108 runs for an improbable, record run chase. Australia needs two wickets to win.
Pakistan's hopes of prolonging the test into a fifth day appeared to plummet when it slumped to 173-5 in the middle session when Younis Khan (65) attempted an impetuous reverse sweep and got an edge off the bat. The ball rolled up his arm and floated up to Steve Smith, who ran behind the wicketkeeper to take a simple catch.
But the resistance was far from over, with Shafiq marshalling the lower order.
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.