Hafeez hit 224 ??? adding 87 to his overnight score ??? as Pakistan eased past the Tigers first innings score of 332, to lead by 205 runs.
Azhar Ali (83) and Misbah-ul-Haq (59) both hit fifties, as did Asad Shafiq (51no) and Sarfraz Ahmed (51no) who finished the day unbeaten.
Only four wickets fell on the day ??? Taijul Islam (3-116) and Shuvagata Hom (2-112) sharing two apiece.
Resuming the day on 227-1, Pakistan put on a further fifty runs before Ali was bowled by offspinner, Shuvagata.
Younis Khan played nicely for 33 before he fell ??? also bowled to a lazy shot off left-arm spinner Taijul ??? shortly after Pakistan passed the Bangladesh score.
Hafeez???s maiden Test double-ton soon followed despite some nervy moments in the 190s, having fallen three short of the milestone in Pakistan???s last Test again New Zealand in November of last year.
He was eventually dismissed shortly before tea while trying to sweep Shuvagata and being caught at leg-slip by Mahmudullah, bringing his 332 ball knock ??? with 23 fours and three sixes ??? to a close.
Three more Pakistani batsmen would pass fifty in the final session, firstly Misbah, before he fell to a top-edge when attempting a sweep off Taijul.
He was followed by Shafiq and Sarfraz ??? who reached his half-century in quick time, off just 54 balls.
It left Pakistan in an utterly dominant position in the Test, closing on 537-5, leading by 205 runs.