Hafeez, who is Pakistan's T20 skipper and vice-captain of the Test and ODI squads, has been omitted following poor form with the bat, a national selector said.
The 32-year-old has struggled for form in recent months and in his last 10 innings has scored just 102 runs.
He fell four times to fast bowler Dale Steyn during Pakistan's 3-0 whitewash by South Africa in the Test series earlier this year.
Hafeez has traditionally struggled against the South Africans, managing just 307 runs in eight tests.
The selectors recalled middle order batsman Umar Amin, who last played a test in 2010 in England, and have also included left-arm spinner Zulfiqar Babar in the 12-man squad.
Babar is the third specialist spinner in the squad with Saeed Ajmal and Abdul Rehman, underlining Pakistan's plans to prepare turning pitches for the tests.
Left-arm paceman Muhammad Irfan was a surprise inclusion as he had not featured in the initial list of 28 probables.
Squad: Khurrum Manzoor, Azhar Ali, Younus Khan, Misbah-ul-Haq, Umar Amin, Adnan Akmal, Junaid Khan, Muhammad Irfan, Rahat Ali, Saeed Ajmal, Abdul Rehman and Zulfiqar Babar.