In 899, a split occurred in the clandestine
Isma'ili movement, directed by the family of the future first
Fatimid caliph,
Abdallah al-Mahdi. Al-Mahdi claimed to be not only a trustee and representative of the
hidden imam, but the true imam in person. Those that rejected this claim became known as the "
Qarmatians". Whether out of genuine conviction or political expediency, the missionary
Abu Sa'id al-Jannabi, who had established his rule in much of
Bahrayn, sided with the latter faction. Allied with the local
Bedouin tribes of the
Banu Kilab and
Banu Uqayl, as well as with the
Persian Gulf merchants, Abu Sa'id was able to capture the region's capital,
Hajr, and in 900 cemented his independence by defeating an
Abbasid army sent to recover control of Bahrayn. The two Isma'ili branches developed in separate ways after the 899 schism. The Fatimid Caliphate was established in 909 in
Ifriqiya. After failing to capture
Egypt early on and expand into the central lands of the Islamic world held by the
Abbasid Caliphate, the Fatimids focused their energy in consolidating their hold on the
Maghreb and fighting against the
Byzantine Empire on
Sicily. At the same time the Qarmatians, after a period of initially peaceful relations with the Abbasids, and driven by
millennialist expectations of Abu Sa'id's younger son,
Abu Tahir al-Jannabi, launched a series of attacks in the 920s that culminated in the
Sack of Mecca in 930. As the expected failed to come, the Qarmatians returned to more peaceful relations after 939, sustained through payments of money to abstain from attacking the
Hajj caravans. As the dominant power in the eastern and northern Arabian peninsula, the Qarmatians even began offering their services as—well paid—guards of the Hajj caravans; when the Bedouin tribe of the
Banu Sulaym raided the caravans in 966, the Qarmatians forced them to return their plunder. Another wave of Qarmatian raids was launched in the 960s, directed against the
Ikhshidid holdings in the
Levant. Frequently allied with the perennially restless Bedouin tribes of the
Syrian Desert, the Qarmatians raided the caravans of merchants and Hajj pilgrims alike, with the Ikhshidids unable to counter their attacks. In 968, the Qarmatians under
al-Hasan al-A'sam even captured
Damascus and
Ramla, withdrawing only after they secured a ransom and an annual tribute of 300,000
gold dinars from the Ikhshidid governor. The Qarmatian attacks undermined the Ikhshidid regime, and effectively severed the overland routes from Egypt and western Arabia to Iraq, helping pave the way for the swift and almost bloodless
takeover of Egypt from the Ikhshidids by the Fatimid general
Jawhar in 969. Medieval historians, as well as some of the first modern scholars to examine Isma'ili history, saw a collusion between the Fatimid enterprise in the west and the Qarmatian attacks in the east, but more recent scholarship has disproven this. The Fatimid caliph
al-Mu'izz () made several attempts to get the scattered Qarmatian communities to recognize his leadership, but although these efforts were successful in some areas, the Qarmatians of Bahrayn persistently refused to do reconcile themselves to Fatimid claims. In reality, the Fatimid conquest of Egypt and the subsequent advance into Syria, which led to the defeat of the last Ikhshidid remnants at the hands of the Fatimid general
Ja'far ibn Fallah in April 970, brought the two Isma'ili powers on a collision course. The Fatimid expansion meant the end of the annual tribute paid the Qarmatians by the Ikhshidids, and the Fatimids' declared intention to restore the safety of the Hajj routes threatened to put an end to the Qarmatians' extortion of the Hajj caravans as well. In addition, the Fatimid hold over Syria was still shaky, and they enjoyed little local support, especially in Damascus, where the populace had resisted, despite being abandoned by their Ikhshidid governor, and the exactions of the Fatimids'
Kutama soldiery after the city's fall had further exacerbated the locals' hatred. The Damascene popular leader Muhammad ibn Asuda even fled to Bahrayn, accompanied by the chieftain of the powerful Bedouin tribe of Banu Uqayl,
Zalim ibn Mawhub, to seek Qarmatian support. ==Anti-Fatimid coalition and the fall of Syria==