Pakistan were 255-3 at the close of play, with Haris Sohail unbeaten on 15 and nightwatchman Mohammad Abbas one not out as Australian bowlers toiled away with little success on a flat Dubai Stadium pitch.
Hafeez, a late inclusion in the squad after a double hundred in a domestic match, led the run-feast with a knock of 126 -- his 10th Test hundred -- during a 278-minute stay at the crease and put on 205 runs for the opening stand with Imam-ul-Haq, who made a career best 76.
Hafeez, whose last of 50 Test appearances came in England two years ago, brought up his hundred by pushing spinner Jon Holland for two after hitting a pair of boundaries off Mitchell Starc the previous over.
Hafeez, whose innings included 15 boundaries, was finally trapped leg before wicket by Peter Siddle by a ball which beat him on the front push.
Imam hit seven boundaries and two sixes -- both off Holland -- to improve on his previous best score of 74 not out made against Ireland at Malahide in May. Azhar Ali scored 18 before giving away his wicket to Holland, caught at mid-off by Starc.
Australia captain Tim Paine brought on Lyon in the ninth over but Pakistan reached lunch at 89-0 before adding a further 110 runs in the second session. Lyon, Holland and Siddle finished a challenging opening day with a wicket apiece.
The second Test starts in Abu Dhabi on October 16.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)