Despite being jolted by spinner Jon Holland’s two key wickets of Mohammad Hafeez (17) and Azhar Ali (four), Pakistan closed the day on 45-3, having an overall lead of 325 with seven second-innings wickets intact to force a win.
Opener Imam-ul-Haq was unbeaten on 23 while nightwatchman Asif was dismissed for nought, unable to guard Azhar from coming to bat in a crucial stage.
But it was a day highlighted by Asif who triggered a memorable Australian collapse against spin in Asia.
But by lunch Australia were well-placed at 137 without loss with Usman Khawaja (85) and debutant Aaron Finch (62), but the slump followed shortly after as the Baggy Greens lost all 10 wickets for just 60 runs.
Asif, who had previously played three one-day internationals in 2015, came into his own after pacer Mohammad Abbas removed Finch following an opening stand of 142.
In a spell of 22 balls Asif took four wickets as Australia slumped to 180-5 by tea.
The second session belonged to Asif, who dismissed Khawaja, Shaun Marsh (seven), Travis Head (nought) and Marnus Labuschagne (nought) in the space of 29 runs.
Asif’s feats on debut had only been bettered by fast bowler Mohammad Zahid (7-66 vs New Zealand in Rawalpindi in 1994) and spinner Mohammad Nazir (7-99 against New Zealand in Karachi in 1969).
Asif is the 11th Pakistani bowler to take five or more wickets in an innings on Test debut.
Before Asif’s brilliance Abbas had forced Finch to drive straight into the hands of Asad Shafiq at short mid-on.
Khawaja hit eight fours before miscuing a premeditated sweep and was caught at short leg while Finch had five boundaries and a six in his knock.
Leg-spinner Yasir was unlucky not to be amongst wickets, having dropped Mitchell Marsh off his own bowling for two and wicketkeeper Sarfraz Ahmed missing a stump in the first session with Khawaja on 17.
Yasir went wicketless after 28 probing overs.
Earlier in the day Finch was more confident as he punched two boundaries and a six off Yasir before sweeping Asif for a boundary to reach his half-century.
Khawaja, the Pakistan-born batsman, improved upon his previous best score in Asia of 26, made against Sri Lanka at Galle in 2011, by reaching his 13th Test half-century.
The second and final Test starts in Abu Dhabi from October 16. Both teams will also play three Twenty20 internationals after Tests.