Ibrahim became active as a rebel following the damaging civil war of 811–813 between the rival caliphs al-Amin and al-Ma'mun, which had greatly weakened the ability of the Abbasid government to maintain its authority in Baghdad and the provinces of the empire. While in Mecca in 815, he was appointed by Abu al-Saraya al-Sari ibn Mansur, who had launched a pro-Alid revolt in southern Iraq and seized the cities of al-Kufah, al-Basrah, Mecca, and Medina, to conquer the Yemen on his behalf, and he accordingly marched south toward the province with a large force. Upon learning of his advance, the governor of the Yemen, Ishaq ibn Musa ibn 'Isa al-Hashimi, decided against putting up any resistance and instead withdrew with his troops for the Hijaz, in effect surrendering the province to Ibrahim. The latter was consequently able to enter the Yemen without facing any significant resistance, and he proceeded to occupy Sana'a in September 815 and take control of the country.