In 750 the Abbasid dynasty overthrew the Ummayad caliph and shifted the capital to Baghdad, with emirs retaining nominal control over the Libyan coast on behalf of the far-distant caliph.
In the last decade of the 9th century, the Ismailis launched an assault on the Sunni Aghlabids.