 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.