Mohammad Abbas took three quick wickets in a devastating burst to put Pakistan on course to win the first Test in Dubai, but Usman Khawaja's unbeaten half-century gave Australia hope on day four.
Abbas (3-26) struck three times without conceding a run after Pakistan declared on 181/6, Imam-ul-Haq top-scoring with 48 as the tourists were set a highly unlikely 462 to win.
Khawaja and Aaron Finch combined for a century stand in the first innings before an almighty collapse left Australia deep in the mire and there was a sense of deja vu on Wednesday.
The openers put on 87 in a positive partnership, but Abbas – who took 4/29 when Australia folded on day three – dismissed Finch (49) before removing brothers Shaun and Mitchell Marsh without scoring.
Khawaja (50 not out) and debutant Travis Head (34no) saw Australia through to 136/3 at stumps, needing a heroic final-day rearguard effort to avoid falling behind in the two-match series.
Australia were in desperate need of early wickets on the penultimate day, but Haris Sohail and Imam added 65 for the fourth wicket after Pakistan resumed on 45/3.
Sohail used his feet superbly to come down the track and hit Jon Holland (3-83) for a couple of sixes and Imam ticked along patiently to keep the lead building.
Holland got the breakthrough when Imam gave him the charge but offered a simple caught and bowled, then Marnus Labuschagne snared Haris lbw in the next over to leave Pakistan 110/5.
Asad Shafiq (41) and Babar Azam (28 not out) added 71 as the Australia bowlers toiled in the heat before the former was taken by Mitchell Marsh with a big heave off Nathan Lyon (2-58), who moved level with Brett Lee's tally of 310 Test wickets.
That prompted the declaration from Sarfraz Ahmed, who gave off spinner Mohammad Hafeez the new ball along with Abbas, but soon turn to Yasir Shah.
Yasir and Bilal Asif, who took six wickets on debut in the first innings, were unable to get the breakthrough as Khawaja and Finch played with assurance, putting away stray deliveries and displaying stoic defence.
From 72 without loss at tea, Australia soon found themselves in trouble when Abbas came struck three times in the space of seven balls, Finch trudging off after unsuccessfully reviewing an lbw decision.
Shaun Marsh was caught behind nibbling at one that nipped away, and his younger brother also fell for a duck, Abbas celebrating another lbw verdict following a review after the ball struck pad before bat.
Khawaja had a slice of luck when he flashed at a delivery from Haris and Shafiq failed to hold on to a difficult one-handed chance at a wide first slip, before the left-hander brought up a second hard-earned half-century of the match, with support from Head.
|Klopp ´would have paid double´ for Alisson|
|Klopp: I don´t care about Madrid revenge mission|
|Tension and anxiety got to Inter, laments Spalletti|
|Tuchel hails magnificent PSG as Red Star win seals last-16 spot|
|Mbappe admits frank discussions inspired PSG´s Champions League progress|
|Klopp: Napoli had no answers to outstanding Liverpool|
|Pochettino proud of ´massive, massive achievement´ for Spurs|
|Barcelona equal Champions League record|
|Composed and controlled Liverpool see off Napoli to progress|
|Tenerife back to winning ways, AEK beat Hapoel|
|Howedes ´hurt´ after emotional Schalke return ends in defeat|
|Kane ´buzzing´ over ´not bad´ draw at Barcelona|
|Robertson hails Alisson´s ´unbelievable´ save as Liverpool progress|
|Red Star Belgrade 1 Paris Saint-Germain 4: Neymar brilliance helps secure Group C top spot|
|Inter 1 PSV 1: Icardi header not enough for the Nerazzurri|
|Liverpool 1 Napoli 0: Superb Salah sends Reds through|
|Club Brugge 0 Atletico Madrid 0: Simeone´s men miss out on top spot|
|Barcelona 1 Tottenham 1: Lucas rescues Spurs late on to secure progress|
|Monaco 0 Borussia Dortmund 2: Guerreiro double snatches top spot from Atletico|
|Butler´s groin strain ´nothing significant´ – 76ers coach Brown|
|Woakes, Curran among leading lights at IPL auction|
|Blue Jays release five-time All-Star Tulowitzki|
|Mourinho: Professionals care more than the fans|
|Casillas reaches 100 Champions League wins|
|Expansion franchise Cincinnati sign Garza, send Kamara to Rapids|
|Manchester City sign United States goalkeeper Steffen for reported £7m|
|Schalke 1 Lokomotiv Moscow 0: Russians miss chance for Europa League reprieve|
|Galatasaray 2 Porto 3: Terim´s men into Europa League after penalty drama|
|Jackman leaves Dragons role|
|Tottenham boosted as Barcelona bench Messi|
|Mane and Henderson in Liverpool XI to face Napoli|
|Mourinho shoots down question over how to get the best from Pogba|
|Ronaldo to start as Allegri aims to avoid Champions League big guns|
|Odriozola: I´m in love with Benzema, he´s the best number nine in the world|
|Vikings fire OC DeFilippo after loss to Seahawks|
|Marcelino suggests Valencia open to Batshuayi departure|
|Bottas to make rally debut in title-winning M-Sport Ford Fiesta|
|Kovac dismisses Pavard speculation|
|Yaya Toure leaves Olympiacos after just five appearances|
|Riise challenges Liverpool to banish Champions League disappointment against Napoli|
|We rallied around it - Durant on Green confrontation aftermath|
|Valencia ´p****d off´ with Fellaini´s controversial Young Boys winner - Soler|
|More must be done to combat racism at Premier League grounds – Chalobah|
|Napoli will not sack ´big signing´ Ancelotti if they miss Champions League qualification, says De La|
|Guardiola not interested in ´exceptional´ Saul|
|Shai gives Windies hope with thrilling ODI run chase|
|Ten Hag unsure whether to risk Ajax stars against Bayern|
|Erasmus to work with Bulls as Springboks assist Super Rugby sides|
|Paul Gascoigne pleads not guilty to sexual assault|
|Joshua is ´begging´ for unification fight, claims Wilder|
|Silva, Fernandinho add to Guardiola´s injury woes|
|Hosszu storms to 14th gold, Seto smashes Le Clos´ world record|
|Raheem is an incredible human being - Guardiola rallies behind City star Sterling|
|Sexton pens IRFU extension until 2021|
|Ajax boss Ten Hag can do big things, says Bayern chief Rummenigge|
|He´s good at basketball – Kerr running out of superlatives for Curry|
|Green thrilled to make Warriors return in victory over Timberwolves|
|Madrid squad great and humble - Solari responds to Ronaldo|
|Langer unsure what to expect from Perth wicket|
|Fournette subjected to alleged racial abuse in Titans loss - Marrone|
|Better and better - Mbappe hails Neymar link|
|It´s the end of one of the best movies you could ever see - James pays tribute to retiring Wade|
|NASA invites Curry to see moon rocks|
|No plan B for LaLiga Miami game after Barcelona withdrawal|
|Messi´s English haul, Neymar eyes hat-trick record - Champions League in Opta numbers|
|LeBron trumps Wade in last dance, Curry scores 38 points|
|Seahawks secure dominant win over Vikings|
|Iniesta visits Messi and former club Barcelona|
|Drake makes plea for ball thrown into stands after Miami miracle|
|´Toughest pretty boy I´ve ever met´ - Langer dismisses Paine concerns|