Azhar passed Majid Khan's previous highest score of 158 posted in Melbourne 44 years ago with a four through the slips cordon off Josh Hazlewood.
At lunch, the tourists were 433 for seven with Azhar unconquered on 196 off 354 balls with recalled pace bowler Sohail Khan hitting out for an unbeaten 65.
The pair plastered the Australian attack in an beaten run-a-ball stand of 116 that the home side seemed incapable of stopping as the tourists looked to set up a declaration.
In October, Azhar joined a select club of batsmen with an unbeaten 302 against the West Indies in Dubai and became the first batsman in day-night Test cricket to achieve a triple century.
More From This Section
It was also the fourth triple hundred by a Pakistani batsman.
Mohammad Amir was the only batsman out in the first session, caught down leg-side by wicketkeeper Matthew Wade off Mitchell Starc for 29 off 27 balls.
Amir, who cracked six boundaries in his breezy knock, put on 49 runs for the seventh wicket with Azhar.