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.
|Capitals give up fourth hat-trick in five games|
|Durant leaving Warriors would be ´great´ for NBA, says McGrady|
|McEnroe: Serena choked in Australian Open loss|
|De Jong an ´important addition´ at Barca, says Valverde|
|´Better outcome than we originally feared´ – Agent on Anthony Davis injury|
|Pacers sweating on Oladipo injury after Indiana star leaves on stretcher|
|De Jong: I spoke to PSG and City before signing for Barca|
|Guardiola wants finals habit at Man City|
|Lakers star LeBron won´t face Timberwolves|
|Valverde doesn´t regret resting Messi despite Barcelona loss|
|In my heart and in my prayers - Ben Yedder pays tribute to missing Sala|
|Real Madrid reclaim world´s highest-earning club title from Manchester United|
|Messi absence no excuse for Barcelona loss, says Suarez|
|Humble Higuain excited by Sarri reunion|
|He must not come and cry after – Goncalves unapologetic over Neymar injury|
|Serie A record-breaker under Sarri - the Opta numbers behind new Chelsea striker Higuain|
|PSG boss Tuchel ´worried´ after Neymar sent to hospital with another foot injury|
|Coles commits to New Zealand and Hurricanes until 2021|
|Guardiola praises City mentality on ´dangerous´ Burton pitch|
|England won ´attritional´ battle, says Anderson after latest landmark|
|AEK, Brose Bamberg secure last-16 spots|
|Sevilla 2 Barcelona 0: Resting Messi backfires for Copa del Rey holders|
|Sarri: Chelsea players agree with me on motivation comments|
|Morata asked to leave Chelsea a month ago, says Sarri|
|Paris Saint-Germain 2 Strasbourg 0: Neymar suffers injury scare in Coupe victory|
|Anderson´s four-wicket haul rocks Windies|
|Burton Albion 0 Manchester City 1 (0-10 agg): Holders coast through to clinch Wembley return|
|PSG´s Neymar hobbles off in Coupe de France clash|
|De Ligt bored of Ajax departure rumours|
|Piatek completes AC Milan move after Higuain exit|
|Super Bowl LIII: Rams RBs v Patriots RBs|
|Chelsea seal Higuain loan|
|Ismaily kicked out of CAF Champions League after fans throw stones, bottles|
|England star Itoje pens new Saracens deal|
|Palace keeper Hennessey charged over Instagram post|
|Chelsea warn supporters over anti-Semitic chanting ahead of Tottenham EFL Cup tie|
|Joshua primed to make call on next opponent|
|Super Bowl LIII: Brady v Goff|
|Sala search suspended as Cardiff chairman confirms club wanted different travel arrangements|
|Cruyff, Koeman, Kluivert - De Jong following pantheon of Dutch Barca greats|
|Sarfraz apologises for comments picked up by stump mic|
|Djokovic: Pouille deserves top-10 spot|
|Hazard must be more demanding if he wants to leave Chelsea, says Ballack|
|Celtics´ Kyrie Irving to sit out Cavs game with flu-like symptoms|
|Barcelona seal €86m De Jong deal|
|Vietnam v Japan: Moriyasu happy to keep doing just enough|
|Hendricks, De Kock and Steyn join up with Proteas squad|
|Lorenzo excited for ´new level´ at Repsol Honda|
|Fernando replaces injured Pradeep in Sri Lanka squad|
|China v Iran: Queiroz wants to exorcise 2015 quarter-final|
|Balotelli joins Marseille until the end of the season|
|Emery gives Monchi ringing endorsement amid Arsenal sporting director links|
|Larry Fitzgerald returning to Cardinals on one-year deal|
|Watson absence ´an opportunity´ for Scotland hopefuls, says Townsend|
|Pochettino open to new signings but Janssen to remain a Spurs outcast|
|´No trace´ of aircraft so far in Sala search|
|Pochettino will not judge Sarri for criticising Chelsea players|
|From front row to four in a row - Best takes on Farrell at Connect 4|
|Hazard an individual, not a leader - Sarri urges Chelsea star to do more|
|Broad left out of England team for first Test|
|Higuain set to sign for Chelsea but won´t face Tottenham – Sarri|
|McGillvary injury blow for Giants|
|Solari praises Marcelo amid exit rumours|
|A-League Review: Joy and pain for De Jong as Sydney close gap|
|Halfpenny, Davies and Williams set to miss France clash|
|India to rest Kohli from back end of New Zealand tour|
|The hand is good - Farrell expects to be fit to face Ireland|
|Martinez leaves Arsenal for Reading loan|
|Beckham becomes Salford City shareholder|
|Maradona hopes Sala will be found alive|