Pakistan were bowled out for 268 in their first innings on the third day of the third and deciding Test in Lahore on Wednesday, in reply to Australia's 391.
Australian skipper Pat Cummins finished with 5-56 and pace partner Mitchell Starc took 4-33 as Pakistan lost their last nine wickets for just 98 runs, giving the visitors a lead of 123.
Opener Abdullah Shafique (81), Azhar Ali (78), and Babar Azam (67) were the main run-scorers for Pakistan.
Australia were once again sloppy in the field as Steve Smith failed to catch Azam off spinner Nathan Lyon when Pakistan's dangerman was on 20.
Pakistan, resuming at 90-1, reached 159 at lunch without losing any more wickets but the second session saw Australia dismiss Abdullah Shafique (81) and Azhar (78) in the space of 44 runs.
Lyon got rid of in-form Shafique in the fifth over after lunch when he forced an edge for wicketkeeper Alex Carey to take the catch.
Umpire Aleem Dar ruled not out but skipper Pat Cummins successfully reviewed the decision in Australia's favour.
Shafique, who hit a century in the drawn first Test in Rawalpindi, batted for 323 minutes, hitting 11 boundaries.
Azhar, who put on an invaluable 150-run stand for the second wicket with Shafique, completed 7,000 runs in his 94th Test when he reached 74.
He is the 54th batsman and fifth from Pakistan to score 7,000-plus runs in Test cricket.
Australia took the second new ball after 80 overs with the total on 191-2 and seven overs later Cummins held on to a sharp caught-and-bowled chance to dismiss Azhar.
Azhar batted for 337 minutes, hitting seven boundaries and a six in his 35th Test half-century.
In the morning session, Australia toiled hard and could have had some reward in the last over before lunch when Azhar, on 62, edged leg-spinner Mitchell Swepson, but Smith at slip failed to hold on to the sharp chance.
Australia's first Test series in Pakistan for 24 years because of security fears has been marred by flat pitches where the bat has dominated the ball.
The first two Tests of the series — the first between the sides in Pakistan since 1998 — were drawn.