Azhar, who reached his double century by smashing a six off left arm spinner Shakib Al Hasan, was dismissed on 226.
Sarfraz Ahmed was batting on 21 at the interval.
Asad Shafiq scored 107 and shared a 207-run partnership with Azhar that propelled Pakistan to a position of dominance.
Off-spinner Shuvagata Hom removed both of the batsmen in consecutive overs to stem Pakistan's run flow.
Taijul Islam has been the best of the bowlers with 3-179 from his 51 overs while Mohammad Shahid and Shuvagata took two wickets apiece.