The early caliphates were always threatened by the radical Kharijite sects, which were especially prevalent among the marginalized populations "who inhabited the borderlands between the desert and the sown" and were hostile to the central authorities. During the 9th century, however, a range of new movements emerged on the basis of Shi'ite doctrines, which replaced Kharijism as the main idiom for opposition to established regimes. Zaydi imams had already established independent dynasties in the fringes of the Abbasid empire, in Tabaristan (864) and Yemen (897), but by the time of al-Muktafi's accession, the core regions of the Caliphate itself were menaced by the Qarmatians, a radical Isma'ili Shi'ite sect. The Qarmatians denounced mainstream Sunni Islam for practices they viewed as deviations from the true teachings of the religion, such as the "hajj" and the worship of the Kaaba, as well as the dwelling in cities and the marginalization of the Bedouin. Consequently the Qarmatians gained many adherents among the latter—although the Qarmatian leadership overwhelmingly came from the urban settlers—and began assaulting the neighbouring Muslim communities. Their missionary efforts soon spread: in 899, the Qarmatians seized Bahrayn, while another base was established in the area around Palmyra. From there the Qarmatians began launching raids against the Abbasid and Tulunid provinces of Syria. In 902, the Qarmatians defeated the increasingly feeble Tulunids and laid siege to Damascus. Although the city withstood the siege, the Qarmatians proceeded to ravage other Syrian towns. At the same time, a Kufan Isma'ili missionary, Abu Abdallah al-Shi'i, made contact with the Kutama Berbers. His proselytization efforts made rapid headway among them, and in 902, he began his attacks on the Aghlabid emirate of Ifriqiya. Its conquest was completed in 909, laying the foundations of the Fatimid Caliphate.