After 868, Egypt became virtually independent of the caliphate with autonomous Abbasid military governors. Shortly after 969, the Fatimids, coming from Ifriqiya, invaded Egypt and made it their governing seat. However, in 1044 they were losing their power and influence because their vassals in Ifriqiya, the Zirids, denounced Fatimid rule and accepted the Abbasids who were geographically too distant to control them, hence resulting in virtually independent rule of the Zirids. Moreover in 1099 the Crusaders were attacking Syria hence the Fatimids asked Saladin, a Kurdish commander, for help who in the process denounced Fatimid rule and recognized the Abbasids.
In 876 the Saffarids of Sistan defeated the Abbasids and this forced the Abbasids to recognize them as governors. When the Saffarids controlled Khurasan, the Samanids retained control over Transoxiana and in 900 the Samanids reconquered Khurasan in the name of the Abbasids who recognized them as governors instead, although they were virtually independent rulers. By 940, the caliphate was a figurehead and real power belonged to the caliphate’s protectors like the Buyid family, who captured Baghdad and reduced the caliphate to figureheads from 945 to 1055 and the Turkish Seljuk sultans who ruled from 1055 to the mid 12th century.