Pakistan were 255-3 at the close of play, with Haris Sohail unbeaten on 15 and nightwatchman Mohammad Abbas one not out as Australia's 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.
Pakistan skipper Sarfraz Ahmed won the toss and decided to bat, and Hafeez and Imam laid the platform for a big first innings as Australia's pace-cum-spin attack was held wicketless before tea.
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.
He was given a life on 74 when Mitchell Marsh could not hold on to a tough chance on the boundary off the bowling of Holland having covered some 20 yards in the outfield.
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.
Hafeez, who turns 38 later this month, was thrilled to be able to aid the team on his comeback.
- Talked out of retiring -
"I am really happy to score this hundred and helping the team," said Hafeez. "We back ourselves to score 250 more runs and then put pressure on Australia."
Hafeez admitted the last few months were very tough on him, having missed out on selection for the Asia Cup held in the UAE last month and then initially in the Test team.
"There were too many problems and I came to a stage where I was ready to take a drastic step (by retiring) but my wife and (former Pakistan bowler) Shoaib Akhtar stopped me. I would have been doing something else had I not been stopped."
It was only after tea that Australia were able to take wickets, with off-spinner Nathan Lyon getting Imam caught behind in the 63rd over of the day.
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.
Australia handed Test caps to Aaron Finch, Travis Head and Marnus Labuschagne while Pakistan included off-spinner Bilal Asif for his first Test at the age of 33.
The second Test starts in Abu Dhabi on October 16.
Aaron FinchAustralia vs PakistanImam-ul-Haqmohammad hafeezPakistan vs Australiapakistan vs australia 2018peter siddle
First Published: October 8, 2018, 8:20 AM IST