Establishment of the Fatimid Caliphate On 18 March 909, the Kutama under the Abu Abdallah decisively defeated the last Aghlabid army at
al-Aribus. The next day, Ziyadat Allah III fled his palace city of
Raqqada for Egypt, taking many of his treasures with him, but leaving most of his extensive harem behind, and taking care to torch the offices of the land tax department and all fiscal records contained therein. Chaos broke out once this became known, as the palaces were ransacked and any thought of further resistance vanished. A delegation of notables surrendered Kairouan, and on the next day, 25 March 909, Abu Abdallah entered Raqqada and took up residence in the palace of the emir.
Regency of Abu Abdallah al-Shi'i As his master was still in faraway Sijilmasa, it was up to Abu Abdallah to establish the new Shi'a regime in Ifriqiya. He issued a letter of pardon () to the citizens of Kairouan and all former servants of the Aghlabid regime, took stock of the contents of the palaces, installed governors, and ordered
changes to the coinage,
calls to prayer and the sermon, and official seals to reflect the new regime. The new ruler was not yet named in public; instead, the new formulas used
Quranic verses or paraphrases that exalted the
Family of Muhammad, the fulfillment of God's promise, the victory of God's truth (), and of the Proof of God (, i.e., the ). Abu'l-Abbas Muhammad, who had escaped from prison and emerged from hiding after his brother's victory, began to spread the Isma'ili doctrine, holding disputations with the local Sunni jurists in the
Great Mosque of Kairouan. Abu Abdallah also chose a new chief (judge), in the person of the local Shi'ite
Muhammad ibn Umar al-Marwarrudhi. As soon as his rule was stable enough, on 6 June 909, Abu Aballah set out from Raqqada at the head of a large army, to find his master and hand over power to him. In his stead at Raqqada, he left
Abu Zaki Tammam ibn Mu'arik, with his brother Abu'l-Abbas Muhammad as his aide. On the way, Abu Abdallah received the submission of
Muhammad ibn Khazar, leader of the nomadic
Zenata Berbers, and overthrew the Rustamid imamate at Tahert, installing a Kutama governor there. Learning of the approach of the Kutama army, the emir of Sijilmasa had Sa'id questioned and put under house arrest along with his son, but otherwise treated well. Their servants on the other hand were thrown into prison, and regularly whipped.
Proclamation of al-Mahdi and coming to Ifriqiya On 26 August 909, the Kutama army reached Sijilmasa, and demanded the release of their captive imam. After brief clashes with the Midrarid troops, Emir al-Yasa fled his city, which was occupied and plundered. Mounted on horseback and dressed in fine clothes, Sa'id and his son were presented to the army, amidst shouts and tears of religious exaltation. On the next day, 27 August, Sa'id was enthroned and acclaimed by the troops. As the historian Michael Brett explains, the occasion had double meaning: on the one hand, it acknowledged Sa'id's caliphate, but on the other, it recognised the Kutama soldiery as 'faithful' () or 'friends of God' (), an elite distinct from the mass of ordinary Muslims. The army remained at Sijilmasa for several weeks, during which delegations offering submission came from across the western Maghreb. The fugitive emir of Sijilmasa was captured, and the Kutama chieftain
Ibrahim ibn Ghalib installed as governor. On 12 October, the army began its return march. On the way it relieved Tahert, which in the meantime had come under attack by the Zenata under Ibn Khazar, attacked the tribe of Sadina in its mountain strongholds, and launched an expedition to capture Ibn Khazar, but the latter managed to flee into the desert. The army then turned northeast, and Sa'id visited
Ikjan, the original base of Abu Abdallah's mission among the Kutama. There Sa'id arranged the affairs of the Kutama tribes, and took care to gather the treasures that had for years been hoarded in his name. After twenty days, the army marched on towards Kairouan, where on 4 January 910 the city notables came forth to greet their new ruler. Asked for a renewal of Abu Abdallah's , Sa'id immediately guaranteed their lives, but pointedly did not say anything about their possessions. The new caliph did not enter Kairouan—which he seems never to have visited during his life—and instead rode straight for Raqqada. On the next day, Friday, 5 January 910, in the sermon of the Friday prayer, a manifesto hailing the return of the caliphate to its rightful possessors, the Family of Muhammad, was read, and the name and titles of the new ruler were formally announced: "Abdallah Abu Muhammad, the Imam rightly guided by God, the Commander of the Faithful".
Domestic policies Challenges of a revolutionary regime The proclamation of al-Mahdi as caliph was the culmination of the decades-long efforts of the Isma'ili , and the first time since the caliphate of Ali ibn Abi Talib (656–661) that a member of the Family of Muhammad governed a major part of the Muslim world. The establishment of the Fatimid Caliphate was part of a wider rise of Shi'a regimes in the 10th-century Muslim world, the so-called "
Shi'a Century", which included the
Zaydi principalities in Yemen and
Tabaristan, the
Hamdanids in Syria, and the
Buyids in Persia and Iraq. As Shi'a imams, al-Mahdi and his successors were not only the secular rulers of a state (), but concurrently also Shi'a imams, at the head of the still extant and wide-ranging network of the , and thus posed a direct ideological challenge to the Sunni Abbasids for the leadership of the entire Islamic world. Already in his inaugural proclamation, al-Mahdi claimed a mandate to "conquer the world to East and West, in accordance with God's promise, from sinful rebels". However, in those universalist claims lay the very problem of the new regime; as the historian
Hugh Kennedy writes, "the moment when a revolutionary movement achieves power is always of crucial importance", since it has to fulfill its promises to its followers. Al-Mahdi had come to power riding a wave of millennialist and messianic promises, his followers expecting a divinely inspired leader capable of performing miracles. Once in power, however, he would prove to be a mere mortal, and focused more on his legitimist claim on the caliphate as a descendant of Ali, rather than attempting to fulfill the overblown expectations placed on the 'Proof of God' that Abu Abdallah had heralded. The way that al-Mahdi tried to manage expectations can be seen in the choice of his regnal name: 'Abdallah Abu Muhammad' was the exact reverse of the name of the Islamic prophet Muhammad, and also ensured that his son, now known as Abu'l-Qasim Muhammad rather than Abd al-Rahman, would bear the same name as the Islamic prophet, as had long been prophesied for the : Abu'l-Qasim Muhammad ibn Abdallah. As Halm points out, this allowed al-Mahdi to shift the millennialist expectations of his followers onto his son, buying time. At the same time, however, this also meant that the singular, semi-divine figure of the was now reduced to an adjective in a caliphal title, 'the Imam rightly guided by God' (): instead of the promised messiah, al-Mahdi was merely one in a long sequence of imams descending from Ali and
Fatima.
Setting up a new administration A major problem faced by al-Mahdi was the narrow basis of the new regime. The Fatimid dynasty was brought to power by the Kutama, who were, according to Brett, "indispensable", but also "a liability and a threat" to its survival. Halm has described the early Fatimid regime as being little more than a "hegemony of the Kutama". The position of these semi-civilised tribesmen as the chosen warriors of the imam-caliph was greatly resented, not only by the other Berber tribes, but chiefly by the inhabitants of the cities, where the Arabic culture predominated. As Halm writes, the situation was similar to a scenario where, "in the early eighteenth-century North America, the
Iroquois, converted to Catholicism by
Jesuit missionaries, had overrun the
Puritan provinces of
New England, installed their chieftains as governors in Boston, Providence and Hartford, and proclaimed a European with dubious credentials as King of England." In Kairouan and the old Aghlabid palace city of
al-Qasr al-Qadim, therefore, local Arabs were appointed:
al-Hasan ibn Ahmad ibn Abi Khinzir and his brother
Khalaf. In the provinces, where Kutama governors were appointed, the first years of Fatimid rule were marked by revolts by the local inhabitants against the arrogance and exactions of the Kutama. While he appointed the Kutama to garrisons and governorships and gave them rich rewards, in order to administer his new state, al-Mahdi required the expertise of the Arab urban population. As Kennedy remarks, unlike the regimes of later radical Isma'ili groups, al-Mahdi's administration was "surprisingly conventional". For this purpose, al-Mahdi had to take over most of the personnel of the Aghlabid emirs, often men of dubious loyalty, like Ibn al-Qadim. The latter had initially followed Ziyadat Allah III into exile, only to abandon him and return to Ifriqiya with a considerable portion of the former emir's treasure. Al-Mahdi now appointed him to two crucial posts as head of the land tax bureau () and of the postal service (). The new caliph established a series of new fiscal departments in emulation of Abbasid practice, but notably not a
vizierate, instead using the post of secretary () to supervise the function of his government. This post was held initially by a holdover from Aghlabid times,
Abu'l-Yusr al-Baghdadi, but after his death in January 911 he was replaced by
Abu Ja'far Muhammad ibn Ahmad al-Baghdadi, who would continue serving in this capacity under al-Mahdi's successors. After the purge of Abu Abdallah al-Shi'i, the caliph also instituted a new department, the 'bureau of detection' () under the supervision of the Muhammad al-Baghdadi. Unlike contemporary Abbasid practice, which relegated this task to a dedicated department, al-Mahdi was careful to hear and judge petitions for redress against abuse by officials () in person. In another notable department from usual practice, there was no department for the army, as the tribally organised Kutama represented the bulk of the Fatimid military. To complement them, al-Mahdi also took over the surviving Aghlabid slave soldiers (), usually of Slavic () or Greek () origin, as well as recruiting black Africans. The Arabic settler army of Kairouan was also retained, albeit relegated to secondary status due to their dubious loyalty.
Purge of Abu Abdallah al-Shi'i The first serious challenge to the new regime arose within the ranks of the very men who had brought it to power, the Kutama chieftains. The prophetic traditions about the , while diffuse, had insisted that his coming would be heralded by celestial signs and portents, that he would be a young man of exceptional beauty, and that he would rapidly and miraculously lead his armies to victory. Not only did al-Mahdi, a 35-year old former merchant accustomed to an easy life, wine, and rich clothing, not match these expectations, but his luxurious lifestyle clashed with the austere doctrines propagated by Abu Abdallah al-Shi'i and hitherto followed by the Kutama. Even Abu Abdallah criticised his master, accusing him of corrupting the Kutama with power, money and luxury and gifts. At the same time, while al-Mahdi reaped the fruits of their sacrifices, the Kutama chieftains saw themselves excluded from the administration, which was staffed with non-Kutama officials, and even with high-ranking members of the Aghlabid government that they had fought against. As a result, Abu Abdallah became disillusioned with his master. As historian Najam Haider writes, this was a "failure of expectations", as al-Mahdi "did not live up to [Abu Abdallah's] vision of a divinely appointed and inerrant figure". An immediate conflict was averted as Abu Abdallah was called to lead an army west in July 910. During the previous months, Sijilmasa had been lost to the Midrarids, Tahert was once more closely besieged by the Zenata, and an uprising broke out among the Kutama, led by a certain Baban. The latter was quickly subdued by loyalist Kutama, and Abu Abdallah managed to defeat the Zenata near Tubna, relieving Tahert and even reaching the Mediterranean coast at
Ténès. He then campaigned against the Zenata and Sadina tribes in modern central Algeria, before returning to Raqqada in the winter of 910/11. At Ténès, however, a conspiracy had begun among the Kutama chieftains: led by Abu Abdallah, they decided to confront the caliph and put his claims to the test. The sources differ on the details, but the Kutama confronted al-Mahdi in a public audience, demanding that he perform a miracle. Abu Abdallah, his brother Abu'l-Abbas Muhammad, Abu Zaki, and the 'supreme shaykh' Abu Musa Harun openly accused him of being a fraud and an impostor. When Abu Musa Harun was murdered shortly after, the other conspirators decided to assassinate al-Mahdi. Possibly due to the doubts of Abu Abdallah, or because they could not agree on his successor, they delayed their action. Informed of their intentions, al-Mahdi moved first. Commanders whose loyalty was suspect were sent to missions away from the capital, and replaced by loyal ones, so that on 18 February 911, Abu Abdallah and Abu'l-Abbas Muhammad were assassinated by loyal Kutama soldiers in the caliph's own palace. News of the death of Abu Abdallah al-Shi'i spread quickly. Al-Mahdi hesitated for two days, but then executed the remaining Kutama leaders involved in the conspiracy. According to Brett, who rejects or doubts the early association of Abu Abdallah with a central movement based at Salamiya, al-Mahdi's triumph in the contest with Abu Abdallah meant the takeover of "an apocalyptic movement on behalf of a messiah in waiting, which had germinated at some time after the [disappearance of the Twelver imams in 874], and flourished on the periphery of the Abbasid empire". Brett further suggests that the events of 911, with the questions raised about al-Mahdi's identity and the murder of Abu Abdallah, are the origins for the story of the schism of 899 and the death of the missionary Abdan, via a garbled transmission in later anti-Fatimid sources.
Suppression of antinomianism The new regime also had to contend with the more extremist tendencies among its own followers. Early Isma'ili doctrine preached that all previous revealed religions—Judaism, Christianity, and Islam itself—and their scriptures were but veils: they imposed outer () forms and rules that were meant to conceal the inner (), true religion as it had been practised in Paradise. The coming of Muhammad ibn Isma'il as the in the end times would reveal these esoteric truths () and release mankind from the obligations of religious law (). Al-Mahdi's modification of Isma'ili doctrine to allow for an indefinite number of imams before the final arrival of the end times changed these expectations, but they continued to be widely held, notably by the Qarmatians and other extremist () groups; as Daftary points out, these doctrines and acts like the Qarmatian
sack of Mecca in 930 "were also seized upon by Sunni polemicists to accuse all Isma'ilis of
libertinism and
antinomianism". As late as 921, al-Mahdi had to take measures against about two hundred of his own Isma'ili followers, who openly flouted Islamic law by eating pork and drinking wine in the month of
Ramadan. The arrested, among them several prominent men from different cities, regarded the previous obligations restrictions imposed by religious law as lifted, and some of them even went as far as to regard al-Mahdi as god manifest on earth. This was anathema to al-Mahdi and his nascent regime: as Halm explains, "Antinomianism meant anarchy, and so long as the Kingdom of God had not dawned – and according to the revised doctrine, it had not yet dawned — the beneficent reins of the law could not be dispensed with". Official Fatimid doctrine henceforth insisted on the continued validity of the and the outer strictures of Islamic law, even for those Isma'ili faithful who had been be initiated into the inner truths; but the latent antinomian tendencies of Isma'ilism would re-emerge in the future, in movements such as the
Druze and the
Order of Assassins.
Maliki hostility During the 9th century, Kairouan had become one of the greatest centres of
Islamic jurisprudence. Its Sunni jurists adopted a critical stance against the Aghlabid emirs, and ambitious chief s played an important, and at times autonomous, political role. Dominated by the conservative
Maliki school since the mid-9th century, the city's jurists were from the beginning a major source of opposition to the new Fatimid regime and its practices. Abu Abdallah and his brother had held disputations with the jurists, trying to win them over to backing the Fatimids' claims of the primacy of Ali and his progeny or the tenets of Isma'ili doctrine, but in vain. During the campaign of Abu Abdallah to Sijilmasa, the people of Kairouan apparently hoped that he would never return. In October/November, two prominent jurists were publicly executed and their corpses drawn through the city as a warning. The letters sent by Abu Abdallah, first from Sijilmasa, and then from Ikjan, about the success of his mission and the imminent arrival of "the Imam, our lord and master, the Mahdi, and his son" were read publicly in Kairouan and sent to all cities of the realm, to discourage opposition. Al-Mahdi also tried to reconcile the Malikis, at least at first, but also did not hesitate to impose Isma'ili ritual practices against their vehement objection; leading to constant tensions between the citizens of Kairouan and the Fatimid governors of the city, who were responsible for their implementation. For the duration of the Fatimids' rule in Ifriqiya, the Maliki elites rejected Fatimid legitimacy. Maliki authors call them merely "Easterners" or even "Unbelievers", and the caliphs by their first names rather than their regnal titles. Al-Mahdi himself was derisively called by the diminutive form of his first name as Ubayd Allah ('Little Abd Allah'); whence the dynasty is usually labelled in hostile Sunni sources as "Ubaydid" (). Consequently, al-Mahdi sought and found support among the Malikis' rivals, the minority
Hanafi school, especially as many of them claimed to have Shi'a sympathies. Men like the first Fatimid chief , al-Marwarrudhi, and the scholar and later Isma'ili ,
Ibn al-Haytham, belonged to this group. In contrast to Kairouan, the court in the palace city of Raqqada was dominated by Isma'ilis: it had its own Isma'ili Kutama , and al-Mahdi's companions from the time of his flight served as its chamberlains. The chief , al-Marwarrudhi, was a particular object of hatred by the Maliki Kairouanis due to his uncompromising stance in persecuting any deviation from Isma'ili precepts. In the end, the many death sentences became too much even for al-Mahdi, who had him executed in 915. His replacement, Muhammad ibn Mahfuz al-Qamudi, was another Ifriqiyan, who lasted in office until his death in 919. His successor was Ishaq ibn Abi'l-Minhal, but he proved too moderate for al-Mahdi and was replaced in October 923 by a more determined and fanatical Isma'ili partisan, Muhammad ibn Imran al-Nafti. As al-Nafti died within a few months of taking office, Ibn Abi'l-Minhal was restored to the post. Another figure accused of tyranny was the governor of Kairouan,
Abu Sa'id al-Dayf, appointed in 918. The Kairouanis turned to the heir-apparent, al-Qa'im, for assistance in mediating an audience with al-Mahdi to air their grievances. Isolated instances show that the caliph's spy network, complemented and extended by the Isma'ili to far beyond the borders of his realm, was active in identifying and eliminating figures who actively opposed the Fatimid regime. On the other hand, according to Halm, the tales in Maliki sources of thousands of martyrs perishing in the dungeons of the caliphal palace are very likely a gross exaggeration: al-Mahdi was willing to tolerate dissent as long as it did not break out into public opposition.
Anti-Kutama riots and the uprising of the anti- In summer 911, a quarrel between a Kutama soldier and a merchant in the old Aghlabid palace city of
al-Qasr al-Qadim led to an uprising in the latter. The revolt, led by men associated with the previous regime, subsided after a few clashes with the Kutama, but after enough time had passed, al-Mahdi launched purges of the uprising's leaders, which encompassed his minister Ibn al-Qadim. This was but the first of many uprisings against the Kutama, however, who quickly became hated. In Tahert, a revolt broke out that killed or drove out the Kutama garrison, and then called the Zenata under Ibn Khazar for aid. A Kutama army defeated the Zenata with heavy losses, and sacked Tahert on 1 October. Its former governor,
Dawwas ibn Sawlat al-Lahisi, was recalled to Raqqada and executed. In April 912, another quarrel between the Kutama and a local merchant led to bloody clashes in the streets of Kairouan, in which all Kutama in the city were killed; the sources report 700 dead. When al-Mahdi tried to discover the leaders of this affair to punish them, he was met with silence, and had to content himself with a delegation of city notables seeking his pardon. This incident rankled with the Kutama, and, coupled with the previous doubts about al-Mahdi, helped spark a new uprising. A young boy, Kadu ibn Mu'arik al-Mawati, was proclaimed as the true , new s were appointed, and a new holy book written. Starting from Ikjan, the original centre of Abu Abdallah's mission, the revolt spread to the cities of
Mila and
Constantine, while a loyalist army sent against them was thrown back after many of the Kutama in its ranks defected. In response, in April/May 912, al-Mahdi officially proclaimed his son, Abu'l-Qasim Muhammad, as heir-apparent (), gave him the regnal name ('He who executes God's command'), and placed him in nominal charge of the army sent to quell the revolt. On 21 June 912, the loyalist army decisively defeated the rebels near Mila. The anti- al-Mawati and the other rebel leaders were soon captured, and prominently featured in al-Qa'im's triumphal entry into Kairouan in autumn.
Foundation of Mahdiya The anti-Kutama riots in Kairouan and al-Qasr al-Qadim highlighted the vulnerability of the palace city of Raqqada, which was poorly fortified. Already in 912, al-Mahdi began seeking a new, and more defensible, site for his residence. He personally travelled the coast for this purpose, even visiting the ruins of ancient
Carthage, before settling on the small peninsula of Jumma. A rocky peninsula of about length and only wide at its base, it was eminently defensible from a land-based attack, and included an ancient
Punic artificial harbour cut into the rock. , the landward gate of Mahdiya Construction began on 11 May 916 with a massive landward wall, whose single gate was considered an engineering masterpiece: the trick of installing the doors on beds of glass, so that a single person could open them, was said to have come from al-Mahdi himself. The new palace city was fortified on the seaward side as well, and included a great
congregational mosque—the only Fatimid-era structure to survive to modern times—two palaces, one for the caliph and one for his heir-apparent, and other buildings for the caliphal court and administration. The only weakness of Mahdiya was its lack of natural resources, especially water; large grain stores and cisterns were built for rainwater, but in case of a siege, the city would have to be supplied by sea. As heavy rainfall damaged the palaces in Raqqada, al-Mahdi expedited the move into the new residence with his court, which took place on 20 February 921, although construction was still ongoing. Mahdiya was palace city, arsenal, treasury, and military stronghold in one; only the Fatimid family and its most loyal members were settled there. The garrison was provided by black African slave troops (), as well as by Slavic slave soldiers and Kutama. The Zawila and Kutama soldiers lived mostly in the city's suburb outside the landward wall. The Arab and its leaders, whose loyalties were suspect, was deliberately excluded.
Death and succession Al-Mahdi died at Mahdiya on 4 March 934, after a period of illness. Al-Qa'im kept his death secret for a hundred days, before announcing a period of public mourning. As the designated () successor of the imam-caliph, al-Qa'im did not face any opposition. His numerous half-siblings by concubines—six sons and seven daughters—never played an important role, and al-Mahdi had deliberately kept them in the palace, not entrusting them with a gubernatorial or military command. Only once, during al-Qa'ims 928 campaign against the Berbers, when he was out of contact with Mahdiya for several weeks and feared lost, did al-Mahdi allow another son, Abu Ali Ahmad, to play a leading role in public ceremonies. The motivation for this unusual move—whether as a result of palace intrigues or due to a genuine concern that al-Qa'im might be dead—and whether al-Mahdi truly intended to promote Ahmad as an alternative successor, remains unknown. Al-Qa'im rushed back to his father's side and consolidated his position, but the affair left a lasting rift between al-Mahdi and his son. However, in Tripolitania a certain Muhammad ibn Talut claimed to be a son of al-Mahdi and laid claim to the caliphate. He managed to rally a large following among the local Berbers, before his deception was discovered and he was executed by his own followers. Otherwise the transition into the new reign was smooth, with al-Qa'im taking up residence in the caliphal palace of Mahdiya and retaining al-Mahdi's ministers in their duties.
Imperial expansion Immediately after stabilising his rule over the former Aghlabid domains, al-Mahdi was virtually obliged to engage in imperial expansion. As Brett puts it, this was ultimately "the goal on which his credibility rested, the conquest of the world to East and West". This meant military operations in three directions at once, against three political and ideological powers that dominated the Mediterranean world: the Muslim "usurpers", the Abbasid Caliphate in the east and the
Umayyad Emirate of Córdoba in the west; and the main Christian enemy, the
Byzantine Empire, in the north, in
Sicily and
southern Italy.
East: Cyrenaica and Egypt Following the consolidation of his rule in Ifriqiya, al-Mahdi's first objective was Egypt, the gateway to Syria and
Iraq, the old heartlands of the Islamic world and seat of their Abbasid rivals. The Fatimids hoped for help from their sympathisers in Egypt; not only had al-Mahdi himself stayed at Fustat in 904–905, but the sources record that the local Abbasid governor was forced to execute several people for corresponding with al-Mahdi and his son, al-Qa'im.
Conquest of Tripoli The first step east was Tripoli, which submitted to the Fatimids following the fall of the Aghlabid emirate. The local
Hawwara Berbers quickly came to resent the overbearing behaviour of the Kutama soldiery, as well as the heavy tax demands placed upon them. A first uprising and siege of Tripoli in 910–911 was followed by a general revolt of the Hawwara in summer 912. The Fatimid governor of Tripoli fled, and all Kutama in the city were slaughtered. Al-Qa'im led a combined land and naval expedition, laying siege to Tripoli until it capitulated in June 913. Al-Qa'im left one of the principal Kutama generals,
Habasa ibn Yusuf, there, to prepare the further eastward expansion of the Fatimid empire.
Loss of Yemen Al-Mahdi apparently also entertained hopes of a pincer movement against Egypt from two sides, with the support of his missionaries in the Yemen. It was not to be: Ibn al-Fadl, who had conquered most of Yemen from his base in the south of the country, renounced al-Mahdi and proclaimed himself as the in August 911. The reasons for this are unclear, but are likely related to the contemporary processes of disillusionment with al-Mahdi in Ifriqiya, and the news of the execution of Abu Abdallah al-Shi'i. Al-Mahdi had also sent a letter to the Yemeni faithful, addressing concerns as to his identity and documenting his supposed genealogy. This letter caused much unease and dissension, for al-Mahdi effectively repudiated the title of 'Proof of God' and the notion of a 'second Muhammad', which had been associated with the until then and in whose name Abu Abdallah had proclaimed his victory. In the same letter, he claimed descent from
Ja'far al-Sadiq, the last common imam recognised by Twelvers and Isma'ilis alike, via al-Sadiq's eldest son
Abdallah al-Aftah, whom he named as the father of his own great-grandfather, Abdallah al-Akbar. Not only did this contradict all previous Isma'ili propaganda, which emphasised that the legitimate imamate had followed the line of al-Sadiq's younger son
Isma'il, but the claimed genealogy was patently false: Abdallah al-Aftah died young, and was commonly known to not have had any offspring. The same letter further upended previous doctrine by emphasising that though he was the expected , his rule would not bring about the end times, but merely represent another link in a line of imams that was to continue endlessly into the future, thereby contradicting all millennialist expectations vested in his person. The other Isma'ili in the Yemen, Ibn Hawshab, remained loyal to al-Mahdi, but was forced to capitulate against Ibn al-Fadl's forces, and hand over his son
Ja'far as a hostage. Both s died within a few months of each other in 915—Ibn al-Fadl was said to have been poisoned by agents of al-Mahdi posing as physicians—leading to the swift collapse of Isma'ili rule in the Yemen. By 917 the Sunni
Yu'firids had completed the reconquest of the country in the name of the Abbasid caliph.
First invasion of Egypt The first expedition against Egypt was launched on 24 January 914, led by Habasa ibn Yusuf. Advancing along the coast, on 6 February it entered
Barqa, the capital of Cyrenaica. There Habasa executed two chieftains of the Mazata tribe, who nine years before had waylaid and robbed al-Mahdi during his journey to Ifriqiya; their sons were also killed, and their womenfolk sold into slavery and their possessions confiscated. Encouraged by this success, on 11 July al-Mahdi sent al-Qa'im with another army east to assume command of the expedition. Disregarding these orders, however, the ambitious Habasa led his forces into Egypt, entering
Alexandria on 27 August. The news of the Fatimid invasion threw Baghdad into a panic. The Abbasid government had paid little attention to the affairs of Ifriqiya and the claims of al-Mahdi—al-Tabari refers to him vaguely as al-Khariji ('the
Kharijite') or Ibn al-Basri ('Son of the Basran')—but now urgent inquiries were made as to his origin and intentions. The Fatimid campaign in Egypt ultimately failed. The attempts to cross the Nile at
Giza and capture Fustat were beaten back, and reinforcements arrived from Syria under
Mu'nis al-Muzaffar in April 915, greatly shoring up the Abbasid position in the country. The Fatimid army was also plagued by indiscipline and a divided command, as al-Qa'im fell out with Habasa. The latter eventually deserted the campaign and returned to Ifriqiya. Alarmed by this, al-Qa'im evacuated Alexandria hastily and without battle, leaving much of his armament and equipment behind, returning to Raqqada in 28 May 915. In his rear, Cyrenaica rose in revolt and overthrew Fatimid control; in Barqa, the entire Kutama garrison was killed. The expedition's failure rocked the Fatimid regime's very foundation and the belief in the divine mission of the imam-caliph was shaken. As a result, discontent arose, particularly among the Kutama sub-tribe of the Malusa, from whom Habasa, now hounded as a criminal, originated. His eventual capture and imprisonment led to the revolt of his brother Ghazwiyya, who had played a crucial role in securing al-Mahdi's regime up to that point, and who had recently been given charge of the entire Kutama country to the west of Ifriqiya. The revolt was quickly crushed, however, and Ghazwiyya and Habasa were executed. When their heads were brought before al-Mahdi, he is said to have exclaimed "Once did these heads enclose the East and West; and now they are contained within this basket!".
Second invasion of Egypt Al-Mahdi immediately began preparations for a second assault on Egypt, starting with the recapture of Cyrenaica. This was accomplished with the surrender of Barqa after an 18-month siege, in April 917. The expedition against Egypt began on 5 April 919, when al-Qa'im, placed in sole command of the campaign, set out from Raqqada. Although Alexandria's Abbasid garrison had been reinforced, it was abandoned without battle upon the arrival of the Fatimid army. Having already acknowledged Fatimid sovereignty during the first invasion and hence now considered in revolt, the city was sacked by the Fatimid troops. Once again, the Abbasids concentrated at defending the Nile crossing at Giza. Al-Qa'im did not move against Giza, however, giving time for Abbasid reinforcements under Mu'nis al-Muzaffar to arrive. On 12 March 920, the Fatimid invasion fleet was destroyed by the Abbasid admiral
Thamal al-Dulafi, crippling the invaders. Pressed for supplies, al-Qa'im repeated his manoeuvre of 914, occupying the Fayyum Oasis. Fatimid troops also succeeded in occupying much of
Upper Egypt, cutting off the grain supply to Fustat. For an entire year after that, both sides avoided open conflict, and engaged rather in a diplomatic and propaganda battle. Mu'nis offered promises of safe-conduct as well as recognition of the Fatimids as autonomous rulers of Ifriqiya in the style of the Aghlabids, if al-Qa'im and his father submitted to the Abbasid caliph. Al-Qa'im rejected these overtures, reiterating the Fatimid claims to universal dominion as the rightful heirs of Muhammad. He also sent letters to Fustat urging the Egyptians to rise in revolt, and to the two
holy cities of Islam,
Mecca and
Medina, demanding recognition of the Fatimid claims to sovereignty over the Islamic world. Finally, in late spring 921, the Abbasids launched their attack, capturing Alexandria and then moving onto Fayyum. Cut off in the oasis, al-Qa'im was forced to abandon all his heavy equipment, and with his army crossed the desert to Barqa.
Raids into Egypt and relations with the Qarmatians For a few years, the Fatimids continued to launch raids from Barqa into Egypt: in 922/23 and 928, Fatimid troops fought Abbasid troops at Dhat al-Himam, some west of Alexandria. In 923/24, the Fatimid commander Masrur ibn Sulayman ibn Kafi raided one of the oases of the Western Desert (likely
Dakhla Oasis), defeated the local governor and occupied the place, before the outbreak of a disease forced him to retreat. These attacks on Egypt coincided with almost a decade of intensive attacks against the Abbasids by the Qarmatians of
Bahrayn, under the leadership of
Abu Tahir al-Jannabi; but contrary to the claims by contemporary Arab historians, and the hypotheses put forth by some early 20th-century scholars of Isma'ilism, no coordination between al-Jannabi and al-Mahdi can be established. When the Qarmatians
sacked Mecca in 930 and stole the
Black Stone, al-Mahdi even sent a letter to Abu Tahir in reproach, and urged him to immediately return of the Black Stone. Towards the end of his reign, al-Mahdi may have begun organising a third invasion of Egypt, but it was not launched until after his death, in 936, during a period of turmoil in the province. Like the previous two attempts, it was unsuccessful: it was beaten back by
Muhammad ibn Tughj al-Ikhshid, who took over power in Egypt and established his own dynasty there. It was not until 969, when the balance of power had shifted much more decisively in favour of the Fatimids and the
Ikhshidid regime had declined, that another invasion was undertaken, leading to the
Fatimid conquest of Egypt.
West: Maghreb and al-Andalus Subduing Berber resistance The core territories of Fatimid Ifriqiya were the same as in
late antique times, when the area had been the Byzantine
Exarchate of Africa: Tunisia, northeastern Algeria, and Tripolitania, which had been highly urbanised since antiquity and were used to regular administration and taxation. Outside these areas, the native Berber tribes resisted fiercely any attempts to impose Fatimid rule. From the sedentary farmers of the
Nafusa Mountains south of Tripoli, to the inhabitants of the
Aurès Mountains in western Tunisia and eastern Algeria—known to Arab authors as the "refuge of all rebels"—to the nomadic Zenata tribesmen of the
central Algerian plateau and the settled farmers of
Ouarsenis in northwestern Algeria, the mountainous areas generally escaped tight Fatimid control. In Tripolitania, the Hawwara Berbers were subdued as part of the consolidation of Fatimid rule over Tripoli, and their western neighbours, the Berbers of the Nafusa Mountains, were conquered in a series of campaigns in 922–923 by the Sulayman ibn Kafi al-Ijjani. An exception was Tahert, which served as a westerly outpost of Fatimid Ifriqiya, located some from the eastern edge of Ifriqiya proper. Its Fatimid governor,
Masala ibn Habus, was a
Miknasa Berber, which brought his tribe under the Fatimid banner. The efforts of the Miknasa to spread Isma'ilism in Ouarsenis, on the other hand, failed miserably, as the missionaries were simply killed by the local population. Likewise, in 922, the Kutama commander Fahlun and his men, trying to impose Fatimid rule in the Aurès, including heavy taxation and the dispatch of hostages to Mahdiya, were overwhelmed by the locals and killed in their sleep. Masala faced the Zenata under their leader Ibn Khazar, who repeatedly tried to wrest control of Tahert from the Fatimids. Masala was killed by his rival in November 924, and was succeeded by his brother,
Yasal. Although the latter was able to repel a Zenata attack on Tahert in 925, the defeat of a Fatimid relief army by Ibn Khazar encouraged other Berber tribes in the area to rise in revolt. This forced al-Mahdi to send al-Qa'im to deal with the revolt in person. The heir-apparent set out in April 927, issuing a call to arms not only for the Kutama tribes, but also the Arab and the subdued Berber tribes such as the Hawwara and Ajisa; to ensure the latter's loyalty, the families of their chiefs were sent as hostages to Mahdiya. Al-Mahdi's old slave Su'luk, now known as the chamberlain Ja'far ibn Ubayd, subdued the Kiyana tribe in the
Hodna Mountains, whereupon al-Qa'im established a new city, named al-Muhammadiya (modern
M'Sila) after himself, to cement Fatimid control over the area. One of the earliest Isma'ili partisans,
Ali ibn Hamdun al-Andalusi, was made its first governor.
Ziri ibn Manad, the leader of another Berber tribe, the
Sanhaja, also offered his submission to al-Qa'im at this time. Al-Qa'im then entered the Zenata lands in the
Zab Mountains, denying them food and pasture, and launching a pursuit of Ibn Khazar. Conditions were hard: uninterrupted rainfall for over a month cut off communications with Mahdiya, where the court feared that the entire expedition was lost. Although Ibn Khazar managed again and again to escape his hunters, in March 928 al-Qa'im sacked the Zenata capital, Zabraqa. The victorious army then returned to Tahert and thence Ifriqiya, being given a triumphal reception at Mahdiya in November 928. His victory dispatch prompted the circulation of a poem, where the al-Qa'im announces himself as the "Son of the Messenger of God" who is about to "roam throughout God's earth...to Egypt and Iraq, and afterwards I shall concern myself with Baghdad". Despite this success, Fatimid rule over the remote areas of the Maghreb was fragile. Even in Tahert, the local population felt at liberty to nominate their own governor, Masala's son
Ali, when Yasal died in 931. Al-Mahdi had to send a military expedition to the city to install his preferred candidate, Yasal's son
Hamid.
Rivalry with Córdoba Apart from the Abbasids, al-Mahdi faced a major Muslim rival closer to Ifriqiya, in the form of the Umayyads of Córdoba, rulers of
al-Andalus (Islamic Spain). However, the confrontation between the two major Islamic powers of the western Mediterranean took place mostly via propaganda and proxies, rather than direct conflict. At the time of al-Mahdi's accession, the Umayyad emirate was plagued by internal dissension, notably the uprising of
Ibn Hafsun, who in his conflict with Emir
Abdallah () pledged his allegiance to al-Mahdi. Al-Mahdi sent
robes of honour and two Isma'ili s to the rebel leader, in whose territories the Friday sermon was read in the name of the Fatimid caliph. Al-Mahdi's campaigns in the western Maghreb, in what is now
Morocco, were in part meant to "spread fear on the threshold of the Iberian Peninsula", according to historian
Farhat Dachraoui, but the restiveness of the Berber tribes limited the ability of the Fatimid ruler to project power beyond Tahert and seriously contemplate an invasion of al-Andalus. Nevertheless, the Fatimid threat was taken seriously by the Umayyad emir
Abd al-Rahman III (), who reinforced his fleet and established patrols along his southern coasts as one of his first measures upon his accession. During the first two decades of his rule, Abd al-Rahman was occupied with suppressing revolts, most notably that of Ibn Hafsun; but as his power grew, in 927 an Umayyad fleet captured
Melilla, establishing it as a military base in the Moroccan coast, followed by
Ceuta in 931. Abd al-Rahman also entered into an alliance with Ibn Khazar, recognising him as the 'paramount emir of the Zenata' and sending him frequent gifts, in exchange for the Berber leader's recognising Umayyad suzerainty. Finally, once he had secured his own position in al-Andalus, in 929 Abd al-Rahman III claimed the title of caliph for himself, establishing the
Caliphate of Córdoba, in a direct challenge to al-Mahdi's pretensions, both temporal and religious.
Attempts to conquer Morocco In June 917, a Fatimid expedition under Masala ibn Habus sacked the coastal town of Nakur (modern
Al Hoceima), the seat of a
small emirate. Its ruler was killed, but his sons fled to
Málaga on the Spanish coast. Once Masala withdrew his army, however, the exiled princes of Nakur returned with the backing of Emir Abd al-Rahman III, and in a single night managed to overthrow the Fatimid garrison of the town. In exchange, Nakur's new emir became a vassal of the Emir of Córdoba. Next Masala moved against the domains of the
Idrisid dynasty, an Alid clan that ruled over what is now northern and central Morocco. At the time, Idrisid rule over Morocco had fractured into various local principalities, led by competing lines of the dynasty that were fighting each other as well as local rivals. Masala forced the Idrisid ruler of
Fes,
Yahya IV, to acknowledge Fatimid suzerainty and pay tribute. Yahya's authority was limited to Fes and its environs, while the rest of the country was given to the governorship of Masala's cousin,
Musa ibn Abi'l-Afiya. Masala returned to Morocco in 921, forcing the emir of Nakur to abandon his capital without a fight. Influenced by the ambitious Musa ibn Abi'l-Afiya, Masala marched on Fes, deposed Yahya IV, and installed a Fatimid governor in the city. On the return march, Masala once more imposed Fatimid rule over Sijilmasa, installing a pliant Midrarid as a Fatimid vassal. The Idrisids' response to the appearance of the Fatimids varied. Prior to the Fatimid invasion, the Idrisids appear to have been aligned with the Umayyads of Córdoba. Some Idrisids accepted al-Mahdi's claims to Alid descent and thus tended to side with the Fatimids, while others resisted Fatimid expansion and turned to the Umayyads of Córdoba for support. One of the latter,
al-Hasan al-Hajjam, rose in revolt and recovered Fes. His rule lasted for about two years, before Ibn Abi'l-Afiya retook the city through treachery and had him killed. Ibn Abi'l-Afiya then launched a widespread manhunt against the remaining Idrisids across Morocco, which ended only after local chieftains warned him of the inappropriateness of hunting down descendants of Muhammad. It is likely that at this point, according to the historian Chafik Benchekroun, Ibn Abi'l-Afiya was acting as an independent agent, "without being really neither pro-Fatimid nor pro-Umayyad". In 929/30, Ibn Abi'l-Afiya brutally sacked Nakur and extended his rule over the coast around the mouth of the
Moulouya River. Another expedition against Ibn Khazar failed to capture the Zenata chieftain. Then, in 931/2, Ibn Abi'l-Afiya defected to Abd al-Rahman III. As Halm writes, "with this, Fatimid rule over the far west collapsed with one blow", and the territories held by Ibn Abi'l-Afiya and Ibn Khazar became an Umayyad protectorate. The governor of Tahert, Hamid ibn Yasal, was immediately sent west to restore Fatimid control. He managed to defeat Ibn Abi'l-Afiya and reoccupy Fes, but this was ephemeral: shortly after the Fatimid troops left the city, it was lost again, and Hamid was imprisoned at Mahdiya for his failure. Ibn Abi'l-Afiya returned to Umayyad allegiance, but was soon after killed by the Idrisids.
North: Sicily and Italy Along with Ifriqiya, al-Mahdi inherited the island of Sicily from the Aghlabids, which had gradually been
conquered from the
Byzantine Empire during the previous decades. Some Byzantine strongholds remained in the mountainous northeast of the island (the
Val Demone), as well as a Byzantine province across the
Strait of Messina in
Calabria. Sicily was the centre of a perennial war with the Byzantines, which was important from an ideological and propaganda perspective, allowing the Fatimids to "appear as champions of the " against the old Christian enemy of the Muslim world, as the historian
Yaacov Lev puts it. At the same time, Lev stresses that the Fatimids were interested more in raiding than outright conquest, that for the Byzantines this was a secondary front, that the fleets involved were small, and that periods of hostility frequently alternated with truces and "a practical policy of
modus vivendi".
Revolts in Sicily In August 910, al-Mahdi sent his governor of Kairouan, al-Hasan ibn Ahmad ibn Abi Khinzir, as the first Fatimid governor to Sicily. Soon he had made himself so unpopular with the Sicilians, apparently due to heavy taxation—Shi'a jurisprudence entailed a 20% income tax known as the 'Fifth' ()—that they rose in revolt, imprisoned him, and asked for his replacement. His replacement, the elderly
Ali ibn Umar al-Balawi, arrived in August 912, but he too was deposed in early 913, and the island rose in revolt under the Aghlabid
Ahmad ibn Ziyadat Allah ibn Qurhub, who renounced Fatimid allegiance and received recognition from the Abbasid caliph. In July 914, the Sicilian fleet, commanded by Ibn Qurhub's younger son Muhammad, raided the coasts of Ifriqiya. At
Leptis Minor, the Sicilians caught a Fatimid naval squadron by surprise on 18 July: the Fatimid fleet was torched, and 600 prisoners taken. Among the latter was the former governor of Sicily, Ibn Abi Khinzir, who was executed. The Sicilians defeated a Fatimid army detachment sent to repel them, and proceeded south, sacking
Sfax and reaching Tripoli in August 914. Only the presence of al-Qa'im, who was then on his way to invade Egypt, deterred an attack on the city. In the next year, however, a similar undertaking failed, with the Sicilian fleet being defeated. Some areas, such as
Agrigento, defected back to the Fatimids. Ibn Qurhub tried to flee to al-Andalus, but was captured and delivered to al-Mahdi. Along with his supporters he was brought to Raqqada, lashed on the tomb of Ibn Abi Khinzir, mutilated, and publicly crucified. The island's capital,
Palermo, resisted until March 917. After its capitulation, a Kutama garrison was installed under the governor
Salim ibn Asad ibn Abi Rashid. The stronger Fatimid presence allowed Salim to secure relative tranquility for the island over twenty years, remaining in office until another revolt overthrew him in 937.
War with the Byzantines In August 918, Salim led a night attack on
Reggio Calabria, which was captured and sacked. In the following year, however, a truce was signed with
Taormina and the other Byzantine strongholds of the Val Demone, possibly so that the Muslim forces could be concentrated on the Italian mainland. There an expedition of 20 ships under Mas'ud al-Fati attacked the fortress of St. Agatha near Reggio in 922/3. In April 924 a major fleet was sent to Sicily, commanded by the chamberlain Ja'far ibn Ubayd. After wintering on the island, he raided
Bruzzano near Reggio, before sailing on to sack
Oria in
Apulia. Over 11,000 prisoners were taken, and the local Byzantine commander and bishop surrendered as hostages in surety for the payment of tribute. The chamberlain returned in triumph to Mahdiya in September 925. (left) sending envoys to Caliph al-Mahdi (right). 12th-century miniature from the
Madrid Skylitzes At about the same time, al-Mahdi made contact with the
Bulgarian emperor,
Simeon I, who sent envoys to propose a joint attack on the Byzantine capital
Constantinople. The Bulgarian ruler suggested that the Bulgarians would invade by land, and the Fatimids come by sea; all spoils would be divided equally, with the Bulgarians keeping Constantinople and the Fatimids gaining the Byzantine territories in Sicily and southern Italy. As a result of a
long war with the Byzantines, by 922 the Bulgarians controlled almost the whole
Balkan peninsula, but Constantinople remained out of Simeon's reach because he lacked a navy. According to the Byzantine source that reports on these negotiations, al-Mahdi accepted the proposal, but the ship carrying the Bulgarian and Fatimid envoys to Simeon was captured by the Byzantines near the Calabrian coast. When the Byzantine emperor
Romanos I learned about the negotiations, the Bulgarians were imprisoned, while the Arab envoys were allowed to return to Mahdiya with rich gifts for the caliph. The Byzantines hastened to renew the 917 peace agreement, including the payment of tribute, and Simeon's death in 927 put an end to his ambitions. Warfare with the Byzantines resumed in 928, when a fleet was sent to Sicily, led by the governor of Kairouan,
Sabir al-Fata. He attacked a locality named ('the caves') in Apulia, and proceeded to sack the cities of
Taranto and
Otranto. The outbreak of a disease forced them to return to Sicily, but then Sabir led his fleet up the
Tyrrhenian Sea, forcing
Salerno and
Naples to ransom themselves with money and precious brocades. In 929, he defeated the local Byzantine on the Adriatic coast, and sacked
Termoli. He returned to Mahdiya on 5 September 930, bringing 18,000 prisoners with him. Encouraged by these successes, al-Mahdi planned a new and larger naval offensive against the Byzantines in Italy, but the arrival of a Byzantine embassy led to the conclusion of another truce in 931/2, which was adhered to until after the caliph's death. ==Legacy==