Fakhar Zaman and Sarfraz Ahmed came to Pakistan's rescue after a blistering spell of Nathan Lyon bowling had handed Australia early control of the second Test on day one in Abu Dhabi.
Pakistan were reeling on 57-5 part way through the morning session, their top order decimated by Lyon (4-78) in the space of six deliveries as he took four wickets for no runs.
That devastating burst took the him up to fourth in his country's all-time Test wickets list, above Mitchell Johnson, but his side's momentum was soon slowed.
Opener Zaman (94) and captain Sarfraz (94) combined for a sixth-wicket stand of 147, carrying Pakistan towards their total of 282 all out, although the wickets fell with some regularity again following that effective partnership.
The efforts of the batsmen were rewarded as Australia made a poor start of their own at the crease, Mohammad Abbas (2-9) taking two early wickets to leave Tim Paine's side on 20-2, trailing by 262.
An unorthodox early Marnus Labuschagne catch accounted for Mohammad Hafeez (4), but Pakistan were progressing steadily before Lyon intervened with an astonishing flurry.
The spinner first caught and bowled Azhar Ali (15) and then tempted Haris Sohail to jab at Travis Head from the following delivery, ending the 20th over on a hat-trick.
Lyon fell short of the treble, but his next over – following Jon Holland's maiden – was just as rewarding, with Labuschagne catching from Asad Shafiq before Babar Azam's stumps were ripped out.
Test debutant Fakhar managed to stand firm, however, and he and Sarfraz gradually turned the tide, plundering boundaries before the end of the first session and then ploughing on towards tea.
Australia looked to be in trouble as the duo raced towards centuries, losing both reviews in a desperate attempt to undo Pakistan, but Labuschagne (3-45) made his lbw breakthrough to stop Fakhar six runs short of a ton.
Sarfraz returned after tea but new partner Bilal Asif (12) did not survive long before edging to Tim Paine, with the skipper finally following as he sliced a tired shot to cover.
The big-hitting Yasir Shah (28) had his leg stump removed by Mitchell Marsh and the innings ended with Mitchell Starc rattling through Abbas (10).
But Abbas ensured Pakistan ended the day on top as he took out Usman Khawaja (3) and Peter Siddle (4), checking Australia's hopes of a straightforward follow-up to the epic draw of the first Test.
|It doesn´t sound real - Molinari stunned by 2018 exploits|
|Wales legend Thomas victim of alleged homophobic attack|
|Marquez crashes again as Dovizioso wins rain-interrupted Valencia GP|
|Warriors owner denies taking sides following Green-Durant spat|
|Alisson can become a global great, says Dida|
|The Sunday Seven - 7 Key Opta facts for NFL Week 11|
|Teen driver ´fine´ after sustaining spinal fracture in F3 crash|
|Willett wins first title since Masters triumph, Molinari tops Race to Dubai standings|
|Southgate overcomes ´stigma´ of being sacked to thrive with England|
|Anthony to Lakers ´not a question for myself´, says LeBron James|
|Warriors´ Stephen Curry staying ´cautious´ with injury recovery|
|Gunter hopes Bale can help family jet in to witness Wales record|
|Root pleased to practice what he preached|
|Tianjin Quanjian threaten action after Modeste returns to Cologne|
|I had to stop Kemba getting 70! – Jimmy Butler reflects on dramatic game-winner|
|Molinari wins Race to Dubai|
|Rooney: Some ex-players can´t come to terms with England doing well|
|In a spin: England´s win against Sri Lanka sets new record|
|Ogier wins sixth straight WRC title|
|Rogic, Kruse to miss Socceroos´ Lebanon friendly|
|Joerger has Kings´ ´full support´, says GM Divac|
|England seal series win over Sri Lanka|
|Butler´s heroics spoil Walker´s 60-point game as 76ers beat Hornets|
|He´s an honest guy – Djokovic defends Zverev after Finals controversy|
|Bonucci boos a ´mistake´ by fans, says Mancinima|
|Ronaldo still part of Portugal squad – Santos|
|Santos satisfied as Portugal reach Nations League Finals|
|Howell holds onto RSM Classic lead|
|McLeish optimistic as Scotland zero in on Nations League promotion|
|Luis Enrique rejects criticism of Spain star De Gea|
|Schmidt dismisses Hansen´s Ireland World Cup favourites claim as ´banter´|
|There are always imbeciles – Bonucci hits back at fans after frosty San Siro reception|
|Portugal draw ´a step forward´ despite poor finishing – Mancini|
|Ireland were just too good - Read|
|Thomas at the double as France end losing streak|
|Albania 0 Scotland 4: Forrest double sets up promotion showdown|
|Italy 0 Portugal 0: European champions outplayed but secure Finals spot|
|Sensational Djokovic marches into final|
|Stander lauds Ireland´s ´unreal´ defence as All Blacks are thwarted|
|Dazzling Ireland claim historic All Blacks scalp in Dublin|
|Federer unimpressed with Zverev boos|
|Let´s get it on! Cheika relishing England clash|
|Croatia coach Dalic to speak with Lovren over Ramos remarks|
|Xhaka puts improved form down to ´freak´ Emery|
|De Gea not lacking confidence, says Spain´s Saul|
|Jordan goalkeeper scores from own penalty area in friendly against India|
|Pollard leads Springboks to Murrayfield victory|
|Fired-up Japan taught England a great lesson - Jones|
|Sarries leave it late to down Sale, Bath and Saints win|
|O´Shea fumes at disallowed Italy try|
|Southgate welcomes England selection quandary|
|Reaching Rooney´s England goals record ´definitely possible´ – Kane|
|Debut try for Cokanasiga as England rally to avoid Japan upset|
|Wembley will galvanise ´tired´ Croatia, insists Dalic|
|Zverev apologises for tie-break controversy amid O2 Arena heckles|
|Marquez happy with fifth after damaging shoulder in Valencia|
|Wales crush Tonga in Cardiff|
|Germany should keep faith in old guard - Bierhoff|
|Injured Lukaku to miss Belgium´s Nations League decider|
|Zverev knocks out Federer to reach maiden ATP Finals showpiece|
|Koroibete double maintains Australia´s 100 per cent record against Italy|
|Juventus´ Khedira sprains ankle in training|
|Van Dijk: Ramos is not my type of defender|
|Vinales grabs Valencia pole as Marquez crashes|
|I don´t deserve Ballon d´Or, Mbappe does – Hazard|
|Reed and Willett share lead in Dubai|
|Romagnoli joins long AC Milan injury list|
|Williamson steadies Black Caps after Boult heroics|
|Griezmann targets swift French response against Uruguay|
|Havertz´s future lies with Bayer Leverkusen – sporting director Boldt|