For the next several decades, Libya was under the purview of the Umayyad Caliph of Damascus until the Abbasids overthrew the Umayyads in 750, and Libya came under the rule of Baghdad. When Caliph Harun al-Rashid appointed Ibrahim ibn al-Aghlab as his governor of Ifriqiya in 800, Libya enjoyed considerable local autonomy under the Aghlabid dynasty. By the 10th century, the Shiite Fatimids controlled Western Libya, and ruled the entire region in 972 and appointed Bologhine ibn Ziri as governor.