Babar Azam's glorious unbeaten 102 kept Pakistan alive but Australia remained on course for victory in the second Test in Karachi on Tuesday.
Set a record victory target of 506, Pakistan lost two quick wickets but Babar would not go down without a fight.
The right-hander combined with opener Abdullah Shafique in a 171-run unbroken partnership for the third wicket in a spectacular rearguard spread over nearly 60 overs.
Pakistan finished day four on 192/2, still 314 behind their target and needing something extraordinary on Wednesday to deny Australia a 1-0 lead in the three-Test series.
Babar's sixth Test century included 12 fours. Abdullah was unbeaten on 71, which included four fours and a six.
"This hundred means a lot to me, it came just when the team needed it," Babar said.
"We lost a couple of early wickets so the plan was to build a partnership with Abdullah and then extend it.
"The match is not over yet. We'll try to continue this partnership tomorrow and the subsequent batsmen would have to show patience too."
Earlier, Australia batted for 25 minutes on Tuesday before declaring their second innings on 97/2, challenging Pakistan to pull off the greatest fourth innings chase in Test cricket history.
Marnus Labuschagne fell for 44, while his Islamabad-born team mate Usman Khawaja followed his first innings 160 with an unbeaten 44.
After four maiden overs of pace bowling against Pakistan, Australia captain Pat Cummins unleashed spin from both ends and was rewarded almost immediately.
Nathan Lyon caught opener Imam-ul-Haq (one) plumb in front of the wicket for one in his first over.
Cummins introduced Cameron Green after lunch and the all-rounder responded by ending Azhar Ali's 54-ball stay with his second delivery.
Azhar (six) ducked under a short delivery that never rose and was given lbw even though replays suggested the ball had brushed his glove before hitting him.
Azhar had a long chat with Abdullah before he accepted the decision, perhaps wary of burning a second review after Imam had wasted one.
Pakistan had to wait until the 26th over for their first boundary of the innings, when Babar drove Mitchell Swepson past point.
Steve Smith dropped Abdullah, then on 20, in the slip and it proved a costly mistake as the opener closed in on his second hundred of the series.
Babar swept Swepson for two to bring up his first Test century in more than two years which earned him a standing ovation from his team mates.
Australia assistant coach Michael Di Venuto was confident the tourists could use the rough patches on the pitch and run through the rest of Pakistan's batting line-up, which includes four left-handers.
"With the leg-spinner (Swepson) and Nathan Lyon, we have got some weapons there when the left-handers do come in," he said. "But we've got a pretty important breakthrough or two to get first."
Captain Rohit quietly mentoring heir apparent Pant?
India-Pakistan series on cards this year?
Check out Team India's home dominance in Tests
WTC: Where does India stand after clean sweep over SL
'The next big thing' in Indian cricket?