According to al-Tabari and al-Baladhuri, in 665 Ziyad ibn Abihi, the practical viceroy of Iraq and the eastern Umayyad Caliphate, centralized the vast region of Khurasan (east of Iran and west of the Oxus) into a single provincial administration based in Merv under the governorship of al-Hakam.[8][1][9] According to an anecdote cited by both historians, Ziyad had intended to appoint the veteran commander al-Hakam ibn Abi al-As al-Thaqafi to the post, but when his chamberlain mistakenly brought al-Hakam ibn Amr to his court he appointed him instead, remarking that al-Hakam was a companion of Muhammad and "an upright fellow" or "a man of nobility".[1][10] Another traditional Muslim report holds that al-Hakam was appointed by Ziyad in 664.[11] Al-Tabari notes that Ziyad also assigned six deputies under al-Hakam charged with the collection of the kharaj (land tax and/or possibly poll tax). [4][12]
Al-Hakam died and was buried in Merv. His appointed successor Anas ibn Abi Unas, who was promptly dismissed by Ziyad, led his funeral prayers.[13] His grave was mentioned by the sources as late as the reign of the Abbasid caliph al-Ma'mun (r. 813–833).[5]