Australian fast bowling pair of Pat Cummins and Mitchell Starc shared nine wickets between them to hand the touring side a first-innings lead of 123 in the deciding third and final test against Pakistan.
Captain Cummins bowled an impeccable line and length to pick up his seventh five-wicket haul in tests while Starc spewed fire with his pace and reverse swing to take four as Pakistan were all out for 268, replying to Australia's total of 391.
The hosts lost their last seven wickets for 20 runs in a dramatic collapse in the final session of the third day at Lahore's Gaddafi Stadium.
Australia openers Usman Khawaja and David Warner managed to see through three overs before stumps to take their side to 11-0, extending the lead to 134 overall.
With Pakistan appearing comfortable at 248-3, left-armer Starc triggered the collapse with a double strike to remove Fawad Alam and wicketkeeper Mohammad Rizwan and then also picked up the prized wicket of Pakistan captain Babar Azam for 67.
Cummins, who had taken the only wicket to fall on Tuesday, ran through the lower order to leave the sparse crowd stunned in silence.
The collapse looked even more unbelievable after Abdullah Shafique and Azhar Ali struck resolute half-centuries, leaving Australia wicketless in the first session to set up a good platform for Pakistan to post a sizeable total.
The 37-year-old Azhar, playing his 94th test but the first at his home ground, made 78 and added 150 for the second wicket with Shafique.
The 22-year-old Shafique, playing only his fifth test, was out for 81, becoming the first wicket to fall in the second session of the day.
The pitch offered some variable bounce but did not pose too many problems for the batters till the final hour of play.
Resuming on 90-1, Shafique and Azhar continued to be watchful but also punished any loose deliveries to keep alive the hosts' hopes of taking a lead in the first innings.
Steve Smith, who has had a tough time in the series with his catching, did not help the Australian bowlers' cause by failing to convert two opportunities at slip.
Smith dropped Azhar, on 62, off leg-spinner Mitchell Swepson and also saw an edge from Babar off Nathan Lyon fly past him with the batter on 20.
It took a spectacular return catch from Cummins to dismiss Azhar, who got past 7,000 runs in tests during his knock.
The first two tests of the series -- the first between the sides in Pakistan since 1998 -- were drawn.