Hafeez was discarded from the Test team for the two-match series against South Africa in October after a run of poor scores in the year.
But the 33-year-old has scored three hundreds in the ongoing five-match one-day series to regain his place in the Test squad.
Pakistan lead the series 3-1, with the fifth and final match in Abu Dhabi on Friday.
The first Test against Sri Lanka starts in Abu Dhabi on December 31. The second Test will be in Dubai (January 8-12) and the third in Sharjah (January 16-20).
Also returning to the Test squad is 25-year-old right-arm paceman Talha, whose only Test in 2009 ended abruptly after a militant attack on the Sri Lankan team bus in March 2009.
Spearhead Umar Gul was also included after he impressed with his form and fitness in the ongoing one-day series, taking three wickets each in the third and fourth one-dayer.
Gul suffered a knee injury during the South Africa tour in March this year which required surgery.
Lanky paceman Mohammad Irfan was not considered after he fractured his hip in the series against South Africa in the UAE last month. He has still not regained full fitness.
Squad: Misbahul Haq (captain), Mohammad Hafeez, Ahmed Shahzad, Khurram Manzoor, Shan Masood, Azhar Ali, Asad Shafiq, Younis Khan, Adnan Akmal, Junaid Khan, Saeed Ajmal, Abdul Rehman, Umar Gul, Rahat Ali, Muhammad Talha.
COMMENTS (4)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ
Flaws of the Pakistani Test teams selection
Botched selection of the Pakistani team for the Test matches against Sri Lanka.
The non selection of Anwer Ali and Suhaib Maqsood, in the team for the Tests, is not only mind boggling but a baffling decision of the collective wisdom of the PCB, as well.
Anwer Ali is miles ahead of Rahat Ali and Muhammad Talha, in batting, fielding and swing bowling combined. In fact, at the moment, he is the best all rounder, available for selection. Last night the TV commentators were calling him by the name of "super sub" for his excellent fielding performances in the ODI matches.
Similarly, the non selection of Suhaib Maqsood is also a most stupid decision. He is a much better and accomplished batsman than Khurram Manzoor, Shan Masood, Azhar Ali and Asad Shafiq, who have been selected ahead of him.
Any future Test match is a very serious matter, because of the applicability of the ranking system, for the Test matches Championship, to be played in the year 2017.
We have no chance to allow any incompetence or favouritism, in the selection of the best of the best players.
Now the Pakistani cricket fans earnestly requests to the H'able PM of Pakistan, to issue necessary orders to the PCB, to immediately include Suhaib Maqsood and Anwer Ali in the Test team, selected to play the 3 Tests vs Sri Lanka.
I hope Talha will be played in the tests. He is one of the fastest bowlers in the country. I would like to see him go all out and bowl with pace. He could be the x-factor in this series.
Ali Khan DET, United States Central Command
@Akhtar: Bro there are serious flaws in Shajreel's technique and he cannot play the ball coming into him at all since he plants his leg in front which gets him trapped. Unlike ODI cricket where bowlers have limited armoury available SriLanka would love to have him open in Tests as they have calculated his deficiency already.
In modern day cricket the first few innings for a batsmen are easier as his technique is not marked and he is an unknown commodity. But when analysts sit and analyse the playing areas and the deficiencies it usually gets difficult. Many examples from Pakistan in the past who had a great start but could not keep up with it because they did not work on their weaknesses. Saleem Elahi , Ali Naqvi , Taufeeq Umar to name a few. All have centuries and good scores at the start of the career and then vanished from the scene.
I think Sharjeel should have been included to give him more exposure. He is talented fellow, we should not waste him. He needs little more confidence and I think Test Match is the best mode to polish him.