Pakistan have declared midway through day four to set Australia a massive victory target of 462, or survive 137 overs to claim a draw in the first Test in Dubai.
The hosts closed their second innings at 6-181 after Nathan Lyon induced Asad Shafiq to hit to Mitch Marsh in the deep, giving the off-spinner his 310th Test wicket to put him equal with Brett Lee as fifth on Australia's all-time Test wicket-taking list (and 29th overall).
Lyon's wicket was the third Australia claimed on the fourth day, all of them to spin, following first-session scalps to Jon Holland and Marnus Labuschagne.
No Test side has ever successfully chased a fourth-innings target greater than 418 anywhere in the world.
Pakistan resumed at 3-45 on Wednesday and left-arm spinner Holland was the first to snare a wicket on a deteriorating pitch in the morning session to finished with 3-81 in a much-improved performance in the second innings.
Holland had Imam-ul-Haq (48) caught and bowled just shy of a half-century after he had earlier been dropped by Travis Head on 26 off the bowling of Holland.
Part-time leg-spinner Marnus Labuschagne claimed his second wicket for the match on debut, dismissing first-innings centurion Harris Sohail (39) lbw with a delivery which pitched well outside the line but spun sharply and crashed into his box.
Sohail was given not out but the decision was overturned after a canny review by Australia skipper Tim Paine.
Debutant off-spinner Bilal Asif (6-36) and paceman Mohammad Abbas (4-29) did the damage for Pakistan as Australia's batsmen crumbled on Tuesday to lose 10-60 in 32 overs.
Australia have only won on three occasions in Test cricket after conceding at least 482 runs in the first innings.
More to come
Day Three report
A spectacular Australian batting collapse orchestrated by an unknown debutant spinner has seen Pakistan dramatically take control of the first Test in Dubai.
Having cruised to 0-142 with first-gamer Aaron Finch and fellow opener Usman Khawaja both eyeing off centuries, Australia fell in a heap to lose 10-60 and fold meekly for just 202 on the game’s third day.
The visitors were confounded by Bilal Asif, a 33-year-old off-spinner playing his maiden Test, who took 6-36 including the three left-handers in Australia's top six, while paceman Mohammad Abbas claimed 4-29 in a relentless display of reverse-swing bowling.
It was a familiar tale for Australia, whose new-look top order failed to stem the procession of wickets, while debutants Travis Head and Marnus Labuschagne were both out for ducks.
Only Mitchell Marsh (12) and Peter SIddle (10) reached double-digits following their openers' encouraging start, as none of the batters who came after Finch and Khawaja faced more than 50 balls.
The startling collapse forced Australia's bowlers to front up for a third straight day, with the spinners grabbing three late wickets to keep the faintest glimmer of hope alive of a positive outcome.
Pakistan opted not to enforce the follow-on despite a mammoth 280-run first-innings lead, going to stumps on 3-45 leading by 325 with Imam ul-Haq 23 not out.
The rhythm of Tuesday's opening session and the one that followed it could hardly have differed more.
Resuming on 0-30 after their encouraging start the previous afternoon, Finch and Khawaja slowly wrestled some momentum back from their opponents with a mix of patience and confident strokeplay.
Khawaja was fortunate to survive an early stumping opportunity, albeit a tricky one, off Yasir Shah after dancing down and missing one that spun down the legside. Keeper Sarfraz Ahmed was nowhere near it, his only consolation was that it wasn't signalled byes despite Khawaja not being much closer than him to making contact.
But the left-hander grew in confidence to reach his first half-century in Asia off 110 balls, audaciously reverse-sweeping Yasir for back-to-back boundaries after passing the milestone.
With the Pakistanis finding some early reverse swing and Abbas posing a constant threat, Finch picked his spots to attack and found the fence three times in seven balls to assert his dominance over Yasir.
Finch too took his chances against the leg-spinner, blasting him for a straight six, and he reached a half-century on debut from 95 balls with a slog-sweep off Asif.
But the departure of Finch, caught at a cleverly placed short mid-on off Abbas, saw Australia squander the hard-earned ground they'd gained and play themselves almost completely out of this Test match.
Bilal proved destroyer-in-chief as he snared four wickets in 22 balls to rip the heart out of the tourists’ top-order.
Shaun Marsh handed him a maiden Test wicket with his wafting cover drive ending up safe in the hands of first slip Asad Shafiq, before Khawaja, eyeing off a breakthrough Test century in Asia, gave a ballooning catch to Imam with an awkward attempt at a sweep.
The game had moved at an easy pace over the first two days but here it kicked it into overdrive, with Yasir cursing himself after putting down a straightforward caught-and-bowled chance off Mitch Marsh.
It mattered little. Head and Labuschagne collectively lasted 11 deliveries as the former prodded one to second slip while the latter was snaffled at short leg from his second ball.
While new leadership duo Tim Paine and Mitch Marsh briefly interrupted the carnage, the reintroduction of Abbas after tea – a canny move from Sarfraz considering most would have just kept the spinners on – saw Marsh caught on the crease and trapped lbw with a late inswinger.
Paine followed him back, offering up a simple bat-pad catch to Imam to hand Bilal a five-wicket haul.
Starc and Siddle briefly rallied, surely hoping they wouldn't have to back up with more bowling having sent down 36.2 and 29 overs respectively in Pakistan's first innings, but their prayers fell on deaf ears.
The tail didn't hang around much longer after Starc's edge behind off Abbas, who then clean bowled Siddle before Bilal's remarkable debut continued by having Lyon caught at square leg for his sixth wicket.
Australia could hardly have wished for a worse first innings with the bat in the new Justin Langer era.
First innings century-maker Mohammad Hafeez and partner Imam rollicked along to put on 37 for the first wicket before Jon Holland broke through as Labuschagne held on to a sharp grab at silly point.
Sent out as a nightwatchman, Bilal made just about his first error for the day when he was caught at short leg off Lyon before Holland removed Azhar Ali lbw after a canny review on the stroke of stumps.
Australia walked off upbeat after their encouraging end to the day but it failed to mask the fact they remain a long way back in this Test.
Australia: Aaron Finch, Usman Khawaja, Shaun Marsh, Mitchell Marsh, Travis Head, Marnus Labuschagne, Tim Paine (c & wk), Mitchell Starc, Peter Siddle, Nathan Lyon, Jon Holland
Pakistan: Imam-ul-Haq, Azhar Ali, Haris Sohail, Asad Shafiq, Babar Azam, Mohammad Hafeez, Sarfraz Ahmed (c & wk), Bilal Asif, Mohammad Abbas, Yasir Shah, Wahab Riaz
Qantas Tour of the UAE
Australia Test squad: Tim Paine (c), Ashton Agar, Brendan Doggett, Aaron Finch, Travis Head, Jon Holland, Usman Khawaja, Marnus Labuschagne, Nathan Lyon, Mitch Marsh, Shaun Marsh, Michael Neser, Matthew Renshaw, Peter Siddle, Mitchell Starc
Pakistan Test squad: Sarfraz Ahmed (c), Azhar Ali, Fakhar Zaman, Imam-ul-Haq, Babar Azam, Asad Shafiq, Haris Sohail, Usman Salahuddin, Yasir Shah, Shadab Khan, Bilal Asif, Mohammad Abbas, Hasan Ali, Wahab Riaz, Faheem Ashraf, Mir Hamza, Mohammad Rizwan, Mohammad Hafeez
Sep 29 - Oct 2: Tour match v Pak A, Dubai
Oct 7-11: First Test, Dubai
Oct 16-20: Second Test, Abu Dhabi