Abu Ahmad Wali 'l-Dawla Khalaf ibn Ahmad (November 937 – March 1009) was the Saffarid amir of Sistan from 963 until 1002. Although he was renowned in the eastern Islamic world as a scholar, his reign was characterized by violence and instability, and Saffarid rule over Sistan came to an end with his deposition. Early life Khalaf was born in the middle of November 937 to Abu Ja'far Ahmad and Banu, a granddaughter of the second Saffarid amir, Amr ibn al-Layth. Little is known about the first twenty-six years of his life; presumably much of it was spent learning. From 957 or 958 at the latest he was recognized as heir to the throne and his name was included on his father's coins. Succession to the Amirate At the end of March 963 Abu Ja'far Ahmad was murdered in Zarang. At the time of the assassination, Khalaf had been outside the capital. When he heard about his father's death, he rode for the town of Bust, whose governor immediately pledged his support. Soon afterward he led an army against Zarang, which was under the control of a rival Saffarid named Abu Hafs b. Muhammad. Seeing Khalaf's army, Abu Hafs fled the capital and sought refuge in Samanid Khurasan, allowing Khalaf to enter Zarang. Shortly after Khalaf was proclaimed amir, he proclaimed Abu'l-Husayn Tahir ibn Muhammad his co-ruler. Abu'l-Husayn Tahir, who was descended from the Saffarids on his mother's side, had been governing Farah but came to Zarang after Abu Ja'far Ahmad was murdered. Khalaf set him up in the Ya'qubi palace and had his name inserted in the khutba beside his. A year after Khalaf's ascension, a riot broke out in Zarang. Led by an ayyār leader and involving the city factions, it was quickly put down. Khalaf then decided to perform the Pilgrimage and departed, leaving Abu'l-Husayn Tahir in charge. Khalaf spent probably one year on the Pilgrimage before returning (965). On the way home he stopped at Baghdad, where the Buyid amir Mu'izz al-Dawla gave him an audience with the Abbasid caliph al-Muti. The caliph confirmed him in his rule of Sistan and gave him a robe of honor and standard. Khalaf felt, however, that Abu'l-Husayn Tahir would not willingly give up control of Sistan upon his return, so he went to the Samanids for assistance and received an army. Returning to Sistan, he forced Abu'l-Husayn Tahir to