Pakistan lost four wickets in the final session as the green-shirts still trail England by 158 runs, with two days left in the first test at the Rawalpindi Cricket Stadium.
Pakistan reached 499-7 at stumps in reply to England’s mammoth first innings total of 657.
Azam lost his wicket to Will Jacks after scoring 136 runs, joining teammates Abdullah Shafique and Imamul Haq on Saturday in scoring a century.
Azam cracked a boundary towards cover off opposition skipper Ben Stokes to reach his eighth century off 126 balls, studded with 13 boundaries.
Azam and debutant Saud Shakeel were at the crease with 106 and 35 respectively.
Azam upped the tempo in the second session after Pakistan lost centurions Shafique (114), Haq (121) and Azhar Ali (27) before lunch.
With a crowd of around 14,000 chanting “Babar, Babar”, the Pakistan skipper responded by taking off his helmet and raising his bat in acknowledgement.
The centuries by Shafique and Haq meant for the first time in 146 years of Test cricket the openers of both teams reached three figures in the first innings.
Their 225-run opening stand — a Pakistan record against England — is also the first time in Test history that two 200-plus opening partnerships were made, following Crawley and Ben Duckett’s 233-run partnership for the visitors.
Pakistan started the day on 181 without loss and Shafique, 89 overnight, was the first to three figures with a sharp single off Joe Root.
Haq, who started the session on 90, followed with a boundary off the same bowler to complete his century.
They both now have three Test centuries and successive hundreds at the venue, having also reached three figures against Australia in March this year.
Zak Crawley (122), Ben Duckett (107), Ollie Pope (108) and Harry Brook (153) scored centuries for England in their first innings.
The Rawalpindi pitch has been heavily criticised, with Pakistan Cricket Board Chairman Ramiz Raja calling it a relic of “the dark ages”.