The 37-year-old was not part of the original 17-member squad announced last week, but after Pakistan suffered losses at the hands of arch-rival India and Bangladesh in the Asia Cup the squad reached out to Hafeez.
Pakistan failed to qualify for the final in the tournament, which India won after beating Bangladesh by three wickets in Dubai on Friday.
Pakistan had previously nursed high hopes for Shan Masood in the ongoing four-day match for Pakistan 'A' against Australia in Dubai but he fell for just 14, forcing the selectors to include Hafeez.
"The national selection committee and the team management has decided to include Hafeez for the two Tests against Australia," said the Pakistan Cricket Board in a statement.
The first Test against the Australians starts in Dubai on Sunday with the second outing scheduled to begin on October 16.
Hafeez played the last of his 50 Tests against England in Birmingham in August 2016.
Last week he scored a double hundred in a domestic first-class match, catching the eye of selectors.
Pakistan Test squad: Sarfraz Ahmed (captain), Azhar Ali, Fakhar Zaman, Imam-ul-Haq, Mohammad Hafeez, Babar Azam, Asad Shafiq, Haris Sohail, Usman Salahuddin,Yasir Shah, Shadab Khan, Bilal Asif, Mohammad Abbas, Hasan Ali, Wahab Riaz, Faheem Ashraf, Mir Hamza, Mohammad Rizwan.
Fakhar Zamanmohammad hafeezPakistan Cricket BoardPakistan vs Australiapakistan vs australia 2018Sarfraz Ahmedtest cricket
First Published: October 1, 2018, 4:17 PM IST