But from 944 to 947 there was a crisis by the revolt of Abu Yazid, who had united the Kharijite Berber tribes of eastern Algeria and overrun Ifriqiya. Imam Al-Qaim was able to hold out in Mahdia with the help of the navy for over a year, but died (17 May 946) before the revolt could be put down. 