Towards religion the Mahdi’s attitude had been at first one of rabid Shiʿism, though he, as one of the fully initiated, could not have been sincere: no doubt he was acting up to what he expected to be the feelings of his subjects so far as he had observed the Katama and the immediate followers of Abu ʿAbdullah: closer acquaintance with the people of Kairawan showed him that he had been mistaken, the people generally were quite ready for a Mahdi, or anyone else, who could establish and maintain an orderly government, but as Muslims they were orthodox by a large majority, and by no means willing to accept the rather fantastic theories of incarnation and transmigration which appealed to the Persian mind. As soon as this was made clear the Mahdi formulated a definite policy in religion, enforcing strictly all the outward observances of Islam, rigidly punctilious in the prohibition of forbidden food and drink, and punishing severely those of the Ismaʿilian sect, who tried to practice the freedom of the higher grades of the initiated. It was no doubt possible for the initiate to disregard the rites of religion in their private life, but any external neglect, likely to cause scandal amongst the populace at large, was treated as a criminal offence: there was none of the open lawlessness of the Qarmatians tolerated in Ifrikiya: the inner grades of the sect were distinguished from other Muslims only by their reverence for the family of ʿAli, whom all revered to some extent, by their repudiation of the first three Khalifs, which was offensive to the orthodox but not intolerable, and by a few minor differences in the ritual of prayer, and in the treatment of the problems of the canon law.
The most difficult problem demanding the new ruler’s immediate attention lay in the lands to the west, for the Mahdi claimed to control all the territory to the Atlantic, over which the Aghlabid princes had pretended to rule. The first difficult task came in the revolt of Tiharet.
For long past the Berber lands of North Africa had afforded a refuge for every persecuted sect and dynasty of Islam. The earliest sect, the Kharijites, the wild men of the desert who adhered to the oldest form of purely Arab Islam, had entered Africa after they had been hunted down and slaughtered in Asia by the Umayyad Khalifs. In the days of the Mahdi they still held their own in the district of Tiharet in the mountainous country of Central Maghrab. They threw off all allegiance to the ruler at Kairawan and invited Muhammad b. Khazar to be their Emir. The Mahdi sent the Katami Aruba b. Yusuf against them: after three days siege the city was taken, plundered, and some 8,000 of the inhabitants slain.
The Umayyads who had put down the Kharijites in Asia had been compelled by the course of events to seek a refuge in Africa for themselves, and thence had passed over to Spain which was regarded as the remotest of the western parts. At this time they were ruling at Cordova (they did not assume the title of Khalif until A.H. 317), and held also some possessions in Africa about Oran. The same Karmati leader who had taken Tiharet was able to seize Oran.
The Idrisid dynasty, descendants of ʿAli by Hasan, expelled from Madina in 169, had founded a state in the remoter part of Morocco where they were still ruling. This state also was attacked by Aruba and reduced, so that all the western lands to the Atlantic coast was brought under the control of the Mahdi (Ibn Khald. i. 244-5, 267-8, etc.).
This course of consolidation of the most loosely held part of the Muslim world speaks well for the organising ability of the general Aruba, and established the Mahdi’s authority upon a sound foundation. It was, however, disturbed by domestic difficulties in the capital. Kairawan was an Arab colony, but under the Mahdi the Berbers were in the ascendant, and racial disputes were inevitable. One day a Katama tribesman treated a city merchant with insolence; a riot ensued, and some 1,000 of the Katama were slain. After this had been repressed the governor rode through the city and ordered the dead bodies of the Berbers to be removed. The workmen who carried out this order threw the bodies into the channel which served as the city sewer. At this the Katama tribesmen removed from the city in indignation, and declared that they would no longer submit to the Mahdi’s rule, and chose a youth named Kadu as their emir. Very soon this rebel was in possession of the whole province of Zab, and the Mahdi sent several generals against him without result. Some of these generals, indeed, deserted to the enemy, for the Berbers were the main fighting force in Africa, and there was a general indignation amongst them at the way in which the Katama rebels in Kairawan had been treated, and there were many followers of Abu ʿAbdullah still who threw in their lot with the revolted Berbers. At length ʿUbayd Allah sent his son Abu l-Qasim, and he, with some difficulty, managed to reduce the tribesmen.
In 300 the colony of Tripoli revolted. There, as in Kairawan, there had been riots between the Berbers and Arabs. When Abu l-Qasim returned from punishing the tribes he advanced to attack Tripoli, whilst the Mahdi at the same time sent a fleet against it, and after some delay it was reduced. Then Sicily revolted, and this proved to be a permanent loss to the Fatimid Khalifs. At first the Sicilians invited Ahmad, a son of Ziadat Allah, the former emir of Kairawan, to take charge. He refused, but after some time, as the invitation was repeated, he consented to be recognised as emir of Sicily. As soon as he was established he sent a letter to the Khalif of Baghdad professing loyalty and asking to be confirmed as emir by the Khalif. Thus Sicily broke away from the Fatimid dominions and became once more a part of the empire of the ʿAbbasid Khalif.
In 301 the Mahdi founded a new city on the coast near Kairawan, and gave to it the name of al-Mahadiya. The site was very badly chosen, and the place afterwards decayed completely, although it served as the Fatimid capital for some generations. At the same time he commenced building a fleet, by the help of which he hoped to make an attack upon Egypt in due course; no doubt he was by this time convinced that his kingdom in North Africa was not likely to be a stable one, just as it had been held precariously by the Arab rulers who preceded him: in fact it was an unsettled and savage country, which could be under control only so long as under actual military occupation. Probably, also, he hoped that the prospect of conquering Egypt would attach the Berbers to him more successfully. The weak point in these plans was that the building and manning of a fleet depended almost entirely on what Greek help he could hire. Soon afterwards he sent his general Khubasa eastwards and extended his authority, somewhat precariously, to Barqa. In the summer of 302 he made his first attempt against Egypt, sending forces by land under his son Abu l-Qasim, and Khubasa against Alexandria. The inhabitants of that city were obliged to take refuge in the ships in the harbour, whilst the invaders plundered their houses. The invading army then passed southwards to the Fayyum, but here they were met by an Egyptian army strongly reinforced from Baghdad, and compelled to retire. The effort, however, had brought the invasion of Egypt within the sphere of practical politics, and the plunder of Alexandria raised much enthusiasm amongst the Mahdi’s followers. At that time the ʿAbbasid Khalifate was in its decline: in Baghdad the government was in the hands of the military guard, the commander of that guard was the real ruler, the Khalif being no more than a figure head liable to be deposed and replaced at the will of the soldiery. The provinces were semi-independent, in most cases ruled by hereditary emirs who paid no more than a formal tribute of respect to the Khalif; indeed, in many cases it meant simply that his name was mentioned in the Friday prayer. Of all the provinces Egypt was, perhaps, the worst administered, and the ripest for falling away from the ʿAbbasid dominions. It was on the verge of disintegration by natural decay, whilst the Fatimid state which coveted it, though outwardly strong and efficient, had already showed that it had the seeds of internal weakness in the tribal jealousies of Berbers and Arabs.
In 307 the Mahdi’s armies made another attempt on Egypt, this time supported by a fleet of 85 ships, which passed along the coast from al-Mahadiya and anchored in the harbour of Alexandria. The Khalif’s officers at Baghdad could only get together 25 ships which were assembled at Tarsus and sailed over to Alexandria. But those twenty-five ships were manned by experienced Greek mariners, and inflicted a decisive defeat on the Mahdi’s fleet.
As Egypt now enters very directly into the affairs of the Fatimids, it will be necessary to consider its condition. For the last four years it had been governed by the Emir Dhuka ar-Rumi, i.e., Ducas the Roman (or Greek). Before the defeat of the Mahdi’s fleet Dhuka resolved to check the invaders who had followed their former route to the Fayyum, and were laying waste and plundering at will. He had great difficulty in inducing the Egyptian army to move at all, but at last marched out to Giza and encamped on the same side of the Nile as the Mahdi’s army. Soon afterwards he died, and the governorship was taken over by Tekin al-Khassa, who had been governor before from 298 to 303 and had been associated with the former victory over the Shiʿites. Immensely popular with the soldiery, his resumption of office made an immediate change, and he was able to take the offensive and inflict a serious check upon the invaders, about the same time as the naval victory at Alexandria. Although the Fayyum was cleared the Fatimid forces were still in control in Upper Egypt, whither their cavalry had pressed on whilst others stayed in the Fayyum. There the extreme narrowness of the Nile valley and the exposed condition of the Bahariya and the other oases always meant a minimum of defence, and the invaders were able to hold their own until the next year. That meant that the whole area was infested by bands of light cavalry, rapidly moving Bedwin, both Berber and Arab, always able to retreat at will into the neighbouring desert and very difficult to be restrained by any ordinary military force. In our own dealings with the Sanusi in 1916 we had experience of such difficulty. The only possible solution is a system of organised military patrol, which takes some little time to dispose efficiently. That Egypt was cleared after a few months’ interval shows that Tekin had considerable ability in handling the military task with which he was confronted.