left Zarang and took up residence in the nearby fortress of Taq and was to receive the revenues of the state lands and part of the revenues from Zarang. As soon as Abu'l-Hasan left Sistan, however, Khalaf broke the truce and attempted to retake Sistan. Husayn barricaded himself in the citadel, but found that its supplies had been depleted by Khalaf's forces during the three-year siege. Realizing that he couldn't hold out for long, he contacted the Ghaznavids for help. The Ghaznavid Sebuktigin made his way to Sistan, but Khalaf managed to bribe him and eventually convince him to assist him instead. With no choice left but to surrender, Husayn sent envoys to seek peace. An agreement was reached on December 25, 983, and to celebrate the peace numerous festivities were held. Husayn died not long after. Later years Khalaf was now the sole uncontested amir of Sistan for the first time in twenty years. During the next several years he gained his reputation for being a great scholar and for encouraging learning within his realm. He is also said to have made another Pilgrimage, though the date of this is uncertain. Upon the deposition of the caliph al-Ta'i in 991 by the Buyid Baha' al-Dawla, he recognized the new caliph al-Qadir. This represented a break between him and the Samanids, who with their vassals the Ghaznavids continued to recognize al-Tai as caliph. In any case, it was probably al-Qadir who gave Khalaf his laqab of Wali 'l-Dawla. Khalaf also conducted a campaign to retake Bust and Zamindawar. These had been virtually lost to the Saffarids during Abu'l-Husayn Tahir's rule; the local Turks had been more or less independent before the Ghaznavid Sebuktigin conquered the region in c. 978. Khalaf occupied Bust in 986 while Sebuktigin was preoccupied with his own campaign against the Hindushah. When the Ghaznavid returned, however, Khalaf was forced to surrender Bust and return the taxes he had taken from the town. Khalaf had several sons; the two oldest, Abu Nasr and Abu'l-Fadl, died of natural causes. The third, 'Amr, spent many years at the court of the Samanid amir in Bukhara. In 988 'Amr was sent back to Sistan, where his father warmly welcomed him. A few years later, however, 'Amr took part in a rebellion against Khalaf. The rebellion was soon put down and 'Amr was jailed; he died in prison shortly after. Following