 The Abbasid–Saffarid partnership in Iran was most clearly expressed against the intrepid general Rafi ibn Harthama, who had made his base in Ray and posed a threat to both caliphal and Saffarid interests in the region.Al-Mu'tadid sent the Dulafid Ahmad ibn Abd al-Aziz to seize Ray from Rafi, who fled and made common cause with the Zaydis of Tabaristan in an effort to conquer Khurasan from the Saffarids.With Amr mobilizing anti-Alid sentiment against him and the expected assistance from the Zaydis failing to materialize, Rafi was defeated and killed in Khwarazm in 896.