In 755, in a palace coup, the emir Abd al-Rahman ibn Habib was murdered by his brothers Ilyas ibn Habib and Abd al-Wareth ibn Habib. Ilyas promptly proclaimed himself ruler of Ifriqiya. The young Habib fled Kairouan and took refuge in Tunis with his uncle Amran ibn Habib, who was appalled at the fratricide.