Australia stayed in control of the first Test against Pakistan despite an early stutter in the second innings after choosing not to enforce the follow-on Saturday.
Steve Smith and Usman Khawaja carried Australia to a watchful 84-2 in the last session on day three for an overall lead of 300 after Pakistan collapsed to 271 all out on the stroke of tea and conceded a 216-run lead.
Smith was unbeaten on 43 and needed a brief on-field treatment after he was struck on the shoulder by a sharp ball from Shaheen Shah Afridi late in the day with Khawaja not out on 34.
- Scorecard: Australia vs Pakistan, first Test, Optus Stadium in Perth
- NOW Sports Month Membership: £21 a month for 6 months
- Get Sky Sports | Download the Sky Sports app
Nathan Lyon grabbed 3-66 and was just one wicket away from the elusive landmark of 500 Test wickets as Pakistan's resistance faded in the first two sessions. Australia's pacers bowled at a disciplined line and length and Lyon also squeezed the batters on a wicket which gave him some assistance.
All-rounder Mitchell Marsh took the prize-wicket of Babar Azam in the first session to go along with his spirited knock of 90 in Australia's formidable first innings score of 487.
David Warner, who scored a century in the first innings, and Marnus Labuschagne both fell in an impressive opening spell of debutant fast bowler Khurram Shahzad as Australia slumped to 5-2 early in the last session.
Warner went without scoring as he holed out at midwicket off Shahzad's short-pitched ball while Labuschagne also got a top edge against the pacer before Smith and Khawaja played out Pakistan's pacers cautiously and put the home team in the driver's seat in the opening Test of the three-match series.
Earlier, Australian pace trio of Mitchell Starc, captain Pat Cummins and Josh Hazlewood combined well with Lyon and broke Pakistan's resistance in the first two sessions after the tourists had resumed on 132-2.
Pakistan lost night-watchman Shahzad for 7 in the first over to Cummins (2-35) after he survived a close run-out off the first ball when Travis Head missed the stumps at the non-striker's end.
Babar and the Imam-ul-Haq combined to steady Pakistan as the skipper opened his account with his trademark cover driven boundary.
The pair had seemingly blunted Australia's vaunted bowling attack for most of the first session, until Marsh (1-34) was given the ball and teased Babar (21) into edging behind with his fifth ball of the day to end the stubborn 48-run partnership off 17 overs.
The star batter's demise triggered a flurry of wickets in the final overs before lunch as Pakistan lost three batters for 14 runs and went to lunch at 203-6.
Lyon ended Imam's impressive and patient innings at 62 off 199 balls, having the opener stumped by Alex Carey for his 498th Test wicket.
It was the ninth half-century in Tests for Imam and came with four boundaries, but the left-hander finally ran out of patience after staying at the wicket for well over five hours.
Starc (2-68) then claimed his second wicket of the innings, bowling Ahmed (3) through the gate with a ball that came back at the right-hander and uprooted the off stump.
Australia continued to press Pakistan's middle-order with the second new ball after lunch as Saud Shakeel (28) fended to Hazlewood's sharp bouncer and ballooned a simple catch to Warner in the slips and Faheem Ashraf (9) was brilliantly snapped low at square leg by Khawaja.
Lyon then had Aamer Jamal (10) stumped before Travis Head kept the off-spinner waiting for elusive milestone when he wrapped up the innings by having No 11 Shaheen Shah Afridi, who offered a simply catch to Khawaja at mid-on.
On Friday's second day of the three-match series, Pakistan fast bowler Jamal grabbed 6-111 in his debut Test as Australia were bowled out for 487 on the back of Warner's first century in almost a year in his farewell Test series and Marsh's 90.
Opening pair of Abdullah Shafique and Imam then thwarted the host's attack for 36 overs before Lyon got Shafique for 42. Starc then removed captain Shan Masood for 30 late in the day.
The Australians are the world Test champions. Pakistan haven't won a test match in Australia since 1995.