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.
|Havertz´s future lies with Bayer Leverkusen – sporting director Boldt|
|Socceroos boss Arnold excited for future|
|South Africa triumph on Gold Coast in truncated T20 clash|
|Germany without Draxler for Netherlands game|
|Barcelona confirm Rakitic hamstring injury|
|Rain halts England´s post-tea flourish|
|Australia 1 South Korea 1: Luongo seals late draw for Socceroos|
|Irving thrives on ´peace´ of being in the zone|
|Lloris admits France could have lost by more|
|Dybala impressed by Argentina´s improved spirit|
|Arsenal chief confirms Super League talks|
|Hooker knocks out Saucedo to retain WBO strap|
|NBA wrap: Kyrie Irving sizzles as Celtics beat Raptors in overtime|
|Jimmy Butler aims dig at Timberwolves following 76ers home debut|
|Koeman surprised by dominant Netherlands|
|Southgate rallies England ahead of Nations League decider|
|Chile 2 Costa Rica 3: Waston brace sinks La Roja|
|Tite inspired by Guardiola´s City|
|Argentina 2 Mexico 0: Funes Mori´s header helps to sink El Tri|
|Lovren ready for ´fiery´ England clash|
|Brazil captain Neymar pleased with stern Uruguay test|
|Ravens´ Flacco doubtful, Jackson could start|
|Richarlison: I want to be at the Copa America|
|Tabarez buoyed by inexperienced Uruguay|
|Howell fires 64 again to extend RSM Classic lead|
|I´m proud of them - Giggs still upbeat despite Denmark defeat|
|Mancini ´very sorry´ for Ronaldo absence|
|Neymar clinches anything-but-friendly win for Brazil over Uruguay|
|Cipriani-inspired Gloucester thrash Tigers|
|Djokovic makes it three wins from three at ATP Finals|
|Germany relegated from Nations League top tier to cap miserable 2018|
|Fulham will back Ranieri in January transfer window if required|
|Brazil 1 Uruguay 0: Neymar penalty settles tight contest|
|Netherlands 2 France 0: Wijnaldum & Depay decisive as Germany are relegated|
|Wales 1 Denmark 2: Jorgensen and Braithwaite seal Nations League promotion|
|Oxlade-Chamberlain targeting early return|
|New Zealand-born Aki will ´relish´ facing All Blacks – Marmion|
|Portugal cannot focus on absent Ronaldo - Santos|
|Ramsey reiterates he wants to stay with Jaguars despite cryptic tweet|
|We tried to hit a home run and it didn´t work out - D´Antoni explains Carmelo exit|
|West Ham´s Zabaleta backs Premier League´s VAR introduction|
|Southgate eyes winning end to England´s ´brilliant year´|
|Patient Zverev seizes opportunity to make amends at ATP Finals|
|Rodgers: Packers still believe they can make playoffs|
|Mahomes hoping to ketchup to Heinz´s touchdown target|
|Ranieri tells Fulham fans not to expect repeat of Leicester ´fairytale´|
|Brown to leave role as RFU chief executive|
|Croatia star Rakitic ruled out of England clash|
|Capital gains for Zverev as he secures last-four spot in London|
|Sancho rise continues with Player of the Month award|
|Jones-Buchanan, Ablett and Briscoe sign new Rhinos deals|
|Root leads from the front as aggressive England assume control|
|Croatia´s Lovren antagonises Ramos and ´rude´ Spain|
|Rakitic has ´enormous respect´ for England ahead of Nations League decider|
|Ireland make flanker switch with Leavy out of All Blacks clash|
|Pakistan rip through Black Caps in Abu Dhabi|
|WATCH: Barcelona mark 15-year anniversary of Messi´s first match|
|Sterling, that you? - Walker uses falling fan to poke fun at England team-mate|
|Fleetwood applies pressure on Molinari, Wallace leads in Dubai|
|Don´t talk to me about VAR – Rakitic not over World Cup final loss|
|Van Dijk leadership essential for Liverpool – Wijnaldum|
|Dalic: Croatia´s bench was ready to stop Spain!|
|Sublime Root century gives England imposing lead|
|Vinicius appreciates Solari influence at Real Madrid|
|Havertz would suit Bayern Munich – Kimmich|
|Wilder: Roach recruitment a sign of Fury nerves|
|Ranieri targets defensive improvements at failing Fulham|
|PSG close investigation into player recruitment practices after finding no discrimination|
|Mayweather: Nasukawa exhibition back on|
|Witsel: Joining Borussia Dortmund my best career decision|