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.
|Rooney deserves special England day - Antonio|
|LeBron thinks back to his roots after latest milestone|
|Messi to return for Argentina next year - General manager Burruchaga|
|Walton salutes LeBron after he surpasses Chamberlain|
|Croatia´s Dalic and Modric not out for Spain revenge|
|Rondo to miss ´a few weeks´ with broken hand|
|Gabi, Juanfran hopeful over Oblak´s Atletico future|
|England rookie Wilson not comparing himself to Kane|
|WATCH: The baskets that moved LeBron James up the all-time NBA scoring list|
|LeBron moves into fifth on scoring list, 76ers fall in Butler´s debut|
|LeBron James into top five NBA scorers: Five quotes from league legends on his greatness|
|LeBron passes Chamberlain for fifth on all-time scoring list|
|Butler: 76ers need time to gel|
|South Africa lose 28-9 in Windies defeat|
|Delph impressed by ´special´ Sancho|
|Bolt may give up on football career despite ´a lot of offers´|
|We´re better than Dortmund – Wagner urges Bayern to respond|
|Raptors fans give former coach Casey standing ovation in return|
|Martinez hails Hazard leadership|
|Muller going through ´difficult´ period, says Low|
|Betances wants Yankees to sign Machado|
|Rays´ Snell, Mets´ deGrom win Cy Young Awards|
|Dinwiddie to debut Stan Lee-inspired shoes against Heat|
|Iberostar Tenerife and Segafredo Virtus Bologna stay perfect in BCL|
|Rooney wanted to finish career at Manchester United|
|Red Sox give manager Cora contract extension through at least 2021|
|WATCH: Ronnie O´Sullivan hits blue with calamitous break-off shot|
|Matuidi: Mbappe has a great personality, like Ronaldo, Messi and Zlatan|
|Cilic beats Isner to hand Djokovic semi-final spot|
|Mendy undergoes knee surgery|
|Warriors´ Curry will not play during three-game road trip|
|Ramos refuses to retaliate after Lovren jibe|
|Qatar pull off shock win over Switzerland|
|Tuilagi could make England return against Australia|
|Rooney has earned England reward - Sarachan|
|Croatia thrashing means nothing now – Luis Enrique|
|Chelsea and Everton among Arnautovic suitors, claims agent|
|TJ Watt hopes to win NFL sacks race with brother JJ|
|Modric defends Ramos after Lovren comments|
|Southgate hails ´outstanding´ Delph as he talks up England strength in depth|
|No war with Manchester United over Fellaini, insists Martinez|
|Rooney to wear number 10 shirt against USA and receive armband from Delph|
|I don´t feel pressure of Liverpool expectations, claims Klopp|
|Steelers´ Roethlisberger texted Bell but ´didn’t hear back´|
|Reus and Kroos to sit out Germany´s clash with Russia|
|Van Dijk happy to recommend De Ligt if Liverpool ask|
|Sauber announce launch of junior programme|
|No ´breathtaking tennis´ in Djokovic´s win against Zverev|
|Curran: England spinners will be key in Kandy|
|Djokovic charges past Zverev to move closer to ATP Finals progression|
|Messi is a football alien - Malcom|
|Sky´s the limit for Sancho, says Dortmund team-mate Pulisic|
|Radwanska retires from tennis at 29|
|Maybe one day - Pulisic open to Premier League move|
|Suso ´proud´ of Real Madrid speculation but happy at AC Milan|
|Betis president convinced Lo Celso will stay|
|Injured Holder out of Bangladesh tour|
|Germany face relegation, final spots up for grabs - Nations League state of play|
|James Rodriguez out for several weeks with knee injury|
|Curran´s brilliant fifty rescues England´s innings|
|Lenglet: No problem with Dembele at Barca|
|Townsend rings the changes for Springboks clash|
|Claudio Ranieri´s managerial career in Opta numbers|
|Mahmudullah´s first century in eight years boosts Bangladesh|
|Fellaini gets the chop ahead of 31st birthday|
|Maradona: Solari will not last at Real Madrid|
|Molinari: Race to Dubai success would not surpass Ryder Cup glory with Fleetwood|
|Dortmund star Sancho was a Bayern target, confirms Salihamidzic|
|Gerrard enjoying ´buzz´ of management|
|Hamilton questions approach to Formula One expansion|