Hafeez fell for 196 and Azhar equalled his highest score as the tourists moved from their overnight position of 334-1 to 488-4 on a rain-hit second day at the Sinhalese Sports Club in Colombo.
Heavy showers on either side of lunch and just before tea allowed just 44 overs to be bowled in the day, in which Pakistan scored 154 runs.
20 Oscar facts: Interesting trivia about the Academy Awards
Photos: Alia Bhatt, Sunny Deol at an event in Mumbai
Photos: Akshay Kumar, Taapsee Pannu promote 'Naam Shabana'
Flashback: When sexy models sizzled in bikinis at Tokyo fashion show
Photos: These Indian cities top the list in online purchase of sex products