Various Shī‘ī groups organize in secret opposition to the Abbasid Caliphate.
Among them are the supporters of the proto-Isma'ili community, of whom the most prominent group are called the Mubarakiyyah.
According to the Isma'ili school of thought, Imam Jaʿfar al-Ṣadiq (702–765) designated his second son, Isma'il ibn Jafar, born in 721, as heir to the Imamate.
However, Ismā‘īl predeceased his father in 755.
Some claimed he had gone into hiding, but the proto-Isma'ili group accepted his death and therefore accordingly recognized Isma'il’s eldest son, Muḥammad ibn Isma'il (746–809), as Imām.
He remained in contact with the Mubarakiyyah group, most of whom resided in Kufah.
The split among the Mubarakiyyah came with the death of Muḥammad ibn Isma'ili in about 813 CE.
The majority of the group denied his death; they recognized him as the Mahdi.
The minority believed in his death and will eventually emerge in later times as the Faṭimid Isma'ili, the precursors to all modern groups.
The majority Isma'ili missionary movement has settled in Salamiyah (in present-day Syria) and has had great success in Khuzestan (southwestern Persia), where the Isma'ili leader al-Husayn al-Ahwazi had converted the Kūfan man Ḥamdan in 874 CE, who had taken the name Qarmaṭ after his new faith.
Qarmaṭ and his theologian brother-in-law ‘Abdān have prepares southern Iraq for the coming of the Mahdi by creating a military and religious stronghold.
Other such locations have grown up in Yemen, in Bahrain in 899 CE and in North Africa.
These attract many new Shī‘ī followers due to their activist and messianic teachings.
This new proto-Qarmaṭi movement continues to spread into Greater Iran and into Transoxiana.
A change in leadership in Salamiyah in 899 leads to a split in the movement.
The minority Isma'ilis, whose leader has taken control of the Salamiyah center, begin to proclaim their teachings—that Imam Muḥammad has died, and that the new leader in Salamiyah is in fact his descendant come out of hiding.
Qarmaṭ and his brother-in-law oppose this and openly break with the Salamiyyids; when ‘Abdān is assassinated, he goes into hiding and subsequently repents.
Qarmaṭ becomes a missionary of the new Imam, Ubayd Allah al-Mahdi Billah, who will found the Fatimid Caliphate in North Africa in 909.
Nonetheless, the dissident group retains the name Qarmaṭī.
Their greatest stronghold remains in Bahrain, which at this period includes much of eastern Arabia as well as the islands that comprise the present state.
Bahrain is under Abbasid control at the end of the ninth century, but a slave rebellion in Basra disrupts the power of Baghdad.
The Qarmaṭians seize their opportunity under their leader, Abu-Saʿid Jannabi, who captures Bahrain’s capital Hajr and al-Hasa in 899, which he makes the capital of his republic.
Once in control of the state he seeks to set up a utopian society.
The Qarmatians are alleged to oppose many of the teachings of the Prophet Muhammad, and they encourage social equality for nomads, townspeople, and peasants.