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.
|Juventus 1 AC Milan 0: Ronaldo heads Bianconeri to Supercoppa glory|
|Kane injury cannot be excuse for Tottenham – Pochettino|
|Woods to open 2019 schedule at Torrey Pines|
|Reported Liverpool target Dabbur to undergo Sevilla medical|
|Lebanon v North Korea: Radulovic calls on players to make history|
|MLS MVP Martinez signs five-year contract with Atlanta|
|WBC set deadline for Wilder-Fury rematch|
|Iran 0 Iraq 0: Team Melli top Group D after dull draw|
|Vietnam 2 Yemen 0: Quang Hai shines to give Golden Dragons hope|
|Bielsa admits to spying on all Leeds´ opponents|
|Valverde open to arrivals amid De Jong tug-of-war|
|Sexton named in Ireland squad for Six Nations openers|
|Higuain benched for Supercoppa Italiana amid Chelsea links|
|De Grandhomme, Latham and Santner back in Black Caps squad|
|Oman v Turkmenistan: Verbeek tells players to ´score as many as possible´|
|Japan v Uzbekistan: Cuper not distracted by potential last-16 opponents|
|Brown desperate for England recall|
|Lowry ties course record in Abu Dhabi|
|James is playing for Bayern future – Kovac|
|Wizards can compete for playoffs in LeBron-less East despite injuries - Brooks|
|Kyrgyzstan 3 Philippines 1: Lux hat-trick gives White Falcons third-place hope|
|South Korea 2 China 0: Son sets the standard as Bento´s men take top spot|
|Saudi Arabia v Qatar: Top spot on the line in Group E|
|Wasps pull off Fekitoa coup|
|Fresh injury woe for Real Madrid defender Vallejo|
|Home sweet home for Wozniacki as Stephens conquers Melbourne demons|
|Nadal: Victory over Ebden a step forward|
|Proteas rest Steyn and De Kock for opening ODIs|
|Nadal and Federer march on as rising stars prosper|
|Barcelona president Bartomeu convinced Valverde will stay|
|Inter forward Keita suffers thigh injury|
|Nadal races into third round with easy Ebden win|
|Kimmich ´perfect´ for Barcelona, says Xavi|
|Richardson and Nabi inspire Renegades´ rout of Sixers|
|This Liverpool isn´t a team of chokers – Mane|
|Central Coast Mariners 2 Melbourne City 1: Late Simon winner ends 10-match losing streak|
|Bryan backs Murray to return after hip resurfacing surgery|
|Scotland coach Townsend turns to trio of uncapped hookers|
|Spurs´ Aurier arrested on suspicion of assault, released without charge|
|That was a fireworks show - Warriors revel in record-breaking first quarter|
|We are in talks with Chelsea – Salihamidzic reiterates interest in Hudson-Odoi|
|´Proud´ Messi recognises impact of team-mates after reaching 400 LaLiga goals|
|Henry v Vieira: The Arsene Wenger proteges to move into coaching|
|Federer enjoys ´cat and mouse´ win over Evans|
|Wozniacki cruises through in Melbourne|
|Federer maintains perfect Australian Open second-round record|
|Warriors set NBA record, Butler´s 76ers rout Timberwolves|
|´I like the fact we beat them´ - 76ers´ Butler revels in win over Timberwolves|
|Murray says he´ll ´probably´ have operation|
|Australian Open tribute for Andy Murray surprises brother Jamie|
|Warriors score NBA record 51 points in first quarter against Nuggets|
|Panthers owner Tepper doesn´t rule out Newton missing 2019 because of shoulder injury|
|De Ligt will be world´s best centre-back – Koeman|
|Ronaldo a ´perfect machine´, says Gattuso|
|Barcelona? I can´t say anything - Stuani|
|Silva upbeat about Man City title chances|
|Celtics youngsters say Irving´s callout ´came from a good place´|
|NFL playoffs: Patrick Mahomes v Tom Brady|
|NFL playoffs: Jared Goff v Drew Brees|
|Sixers sign Brewer to 10-day contract|
|Lozano and Morgan scoop CONCACAF awards|
|Lakers ´optimistic´ about LeBron injury|
|Giants produce mammoth fourth quarter against Nymburk|
|Austin FC to join MLS in 2021|
|Henry, Vieira look forward to reunion when Monaco host Nice|
|Barcelona reject Neymar phone call reports|
|Wentz is the quarterback ´going forward´, says Eagles coach Pederson|
|Gattuso: Higuain has not asked to leave|
|Drew Brees by the Opta numbers: 10 facts for QB´s milestone birthday|
|Harry Kane injury: England captain´s history of ankle woe|