Australia 318 and 262 (Marsh 96, Carey 53, Smith 50, Hamza 4-32, Afridi 4-76) lead Pakistan 264 by 316 runs
In sunny conditions at the MCG, Carey hit 53 and was the last batter dismissed to steer Australia into a strong position.
Pakistan’s batters face a tough 40-minute period before lunch on a surface with inconsistent bounce as they look to end a 15-Test losing streak in Australia.
Australia recovered well after crashing to 16 for 4 inside the opening six overs due to 153-run partnership between Mitchell Marsh and Steve Smith in the highest fifth-wicket stand in Test history from a total of 20 for 4 or lower.
Marsh on 20 was badly dropped by Abdullah Shafique at first slip off quick Aamer Jamal when Australia were 46 for 4. He made a dejected Pakistan pay with 96 off 130 balls to continue his rich form since being recalled to the team in Headingley during the Ashes.
In contrast to an aggressive Marsh, Smith batted watchfully and did not hit a boundary until the 101st delivery he faced. He made 50 off 176 balls before falling to Afridi on the last ball of day three.
Australia resumed at 187 for 6, with a lead of 241, and holding control but with work to do after a frenetic day three.
Pakistan needed early inroads but Afridi and seamer Hasan Ali could not find bite on a surface that appeared to be playing much better than on day three as Carey and Mitchell Starc quickly added 22 runs.
As Australia’s lead sped past 250 runs, Pakistan desperately needed a breakthrough and Afridi oblidged by having Starc caught at first slip by Babar Azam, who moved well to his right to complete the catch.
Babar late on day three moved into first slip replacing a rattled Shafique, who had also at the start of the match dropped a sitter to reprieve opener David Warner.
But a frustrated Pakistan could not get through the tail as Pat Cummins provided support for Carey to inch Australia towards a lead of 300 runs.
Having been dropped early in Australia’s World Cup title run, Carey entered the summer under some pressure but batted calmly to add valuable runs.
He nudged the ball around and occasionally put the ball away with his most audacious shot being an upper cut over the slips off Afridi.
Jamal had Cummins on 16 caught behind off a faint inside edge in a decision upheld by DRS. There was no mark on hot spot, but a small spike on snicko as Jamal soon claimed his 12th wicket in the series after knocking over Nathan Lyon, who had hit a couple of boundaries to power Australia to a lead of over 300 runs.
Hamza was held back until the second new ball was taken 80 minutes into the day’s play after a starring role on day three, where he knocked over Warner and Travis Head in consecutive deliveries as part of a four-wicket haul.
Tristan Lavalette is a journalist based in Perth