At length, about the middle of Rabiʿ I. 288 (Feb., 900 A.D.) they reached home, and every one of his companions pressed the missionary to be his guest. He declined all these offers of hospitality and asked them to inform him where was the valley of al-Khiyar (the righteous men). This enquiry greatly astonished them as no one could remember that such a name had ever been mentioned in his presence: they admitted, however, that there was such a place and described its situation, and he then told them that he would take up his abode there and visit each of them from time to time. He then set out with some guides to Mount Inkijan where the valley is situated, and when they arrived there he told his companions, “Here is the ‘Valley of the righteous men’ and it is on your account that it is thus named, for one reads in the traditions that ‘the Mahdi will be obliged to make his migration, and will be helped in his flight by the Righteous Men who will be on earth at that time, and by a nation whose name is derived from kitman’; it is because you will rise up in this valley which has been named ‘The valley of the Righteous Men’” (Maq. ii. 11). The derivation of the Berber name Katama from the Arabic kitman “secret” was, of course, no more than a play upon words.
Very soon the dwellers in the vicinity began to spread Abu ʿAbdullah’s reputation, men came from all parts to visit him, and he completely swayed a large body of Berber tribesmen amongst whom the Katama tribe was most prominent. He made, however, no further mention of the Mahdi, and did not seem to interest himself in the subject. But he connected his work with that of the two former missionaries and said: “I am the man entrusted with the sowing of whom Abu Safyan and Hulwani spoke to you,” and this increased their attachment towards him and his importance in their eyes (Maq. id. 37). Some, however, regarded him with disfavour, for evidently there were Berber tribes which had not adopted Shiʿite doctrines: but the Katama tribe under its chieftain Hasan b. Harun supported him, and took up arms against those who tried to interfere with his work. This inter-tribal dispute was the beginning of a long conflict, which ultimately made the Shiʿites dominant in North Africa. Supported by the Katama and a number of Kabyle tribes Hasan attacked and captured the town of Tarrut, and then advanced against Meila.
Already reports of the religious teacher of Mount Ankijan had spread through the province of Ifrikiya, and had reached Ibrahim b. Ahmad the Aghlabi Emir. These Aghlabids were hereditary governors of Ifrikiya established at Kairawan about 184 by the ʿAbbasid Khalifs, to whom they paid tribute and were subject. Desirous of obtaining more accurate information Ibrahim had sent to the governor of Meila to make enquiry about Abu ʿAbdullah and his doings, but the governor had sent back to Kairawan a somewhat contemptuous account of him, in which he was described as a religious fanatic, a devotee revered as a saint by the ignorant people, and so the political possibilities of his activity were overlooked.
The taking of Tarrut and the advance on Meila, which city, after a brief resistance, was betrayed by some of its inhabitants, made a change in this attitude. Ibrahim sent an army under his brother Ahwal against Abu ʿAbdullah and his followers, and defeated them, after which Ahwal returned home fully convinced that the rising had been finally disposed of. From this defeat Abu ʿAbdullah retired to Mount Ankijan where he established a “house of flight,” and there he gathered his partisans around him. As soon as he heard of Ahwal’s retirement he began a series of forays, pillaging the surrounding districts and annoying those who did not join the Shiʿite sect. At this Ahwal made a new expedition, but this time he suffered a repulse, not severe enough to force him to retreat, but compelling him to be satisfied with a defensive police duty in the neighbourhood which was, however, effectual in checking the Shiʿite raids. But this did not last long. In 291 (= A.D. 903) Ibrahim the Aghlabi died, and the governorship passed to his son Ziadat Allah, a man indolent and entirely devoted to pleasure, who recalled his brother Ahwal from his military duties.
This, of course, opened new opportunities for Abu ʿAbdullah, and very soon his followers were ranging at will through the whole province of Ifrikiya, and he boldly declared that the Mahdi was now near at hand and would soon appear in Africa, and would prove his sacred mission by working miracles (Maq. ii. 11). Common report affirmed that Abu ʿAbdullah himself had done many wonders, even making the sun rise in the west, restoring the dead to life, and other marvels. Not only had he now a very large following amongst the Berber tribesmen, but many of the officers serving under Ziadat Allah were well disposed towards the Shiʿite claims, and were secretly in correspondence with Abu ʿAbdullah.
At this juncture, in 291, the Shiʿites were practically supreme in all the country west of the suburbs of Kairawan, and now Abu ʿAbdullah sent messengers over to the Mahdi inviting him to cross into Africa. Ismaʿil had just died at Salamiya, and shortly before his death advised his son Saʿid to migrate to a distant land. As soon as his father died Saʿid and his son Abu l-Kasam Nizar set out from Salamiya intending to go to Yemen, but hearing of the success in North Africa changed their course in that direction, probably meeting the messengers from Abu ʿAbdullah on the way (cf. Ibn Khaldun ii. 515-516). The journey was beset with great perils, especially in the passing through Egypt. At that time the governor of Egypt was Abu Musa Isa b. Muhammad Nushari, who had been appointed after the death of Ibn Tulun in 292, and held office until the government was usurped by Khalanj in 293-4, after which the Khalif al-Muqtadi restored him to office which he held until his death in 297. Saʿid, or ʿUbayd Allah as he now preferred to call himself, arrived during this latter period of office, and the governor had grounds of suspicion about him without very clear information. The refugees left Misr, the old capital lying to the south of the present Cairo, but the governor followed and overtook them. He attempted no violence, but joined their company and induced them to rest with him in a garden, his guard meanwhile surrounding the place. He tried every means to win their confidence, and so to find out who they were and what was the object of their journey: he tried to coax ʿUbayd Allah to join him in taking refreshment, but ʿUbayd Allah declined on the pretext that he was then observing a fast: then he tried to get information by judicious questions, but in vain. At length he allowed ʿUbayd Allah to go on his way. He offered the travellers an escort, but this was politely declined. Then the governor assembled his men to return home, but many of them showed their discontent that the travellers had been allowed to escape, and on second thoughts the governor himself regretted that he had not detained them for further enquiry, and sent a body of men after them, but they had made good use of their start, and it proved impossible to overtake them. Some said that the governor had been bribed by ʿUbayd Allah, and this seems to be likely enough.
After this escape ʿUbayd Allah, his son, and Abu l-ʿAbbas, the brother of Abu ʿAbdullah, went on to Tripoli. The next town on their way would be Kairawan, and ʿUbayd Allah was distinctly anxious about venturing there, so he sent forward Abu l-ʿAbbas to obtain information. Now it appears that Ziadat Allah had much clearer grounds of suspicion than the Egyptian governor, and Abu l-ʿAbbas was not able to escape suspicion, and was taken prisoner. Ziadat Allah does not seem to have been so much interested in the prisoner himself, but made every endeavour to find out some details about the companions with whom he was travelling. Abu l-ʿAbbas denied that he had travelled with any companions, or that he had any knowledge of a fugitive from Syria: he asserted that he was simply a merchant passing through Ifrikiya on his own business. But Ziadat Allah’s suspicions were not allayed: Abu l-ʿAbbas was detained in custody, and a messenger was sent to Tripoli to secure the arrest of the other travellers. The messenger, however, returned with the reply that ʿUbayd Allah had already left the city before the order for his arrest had arrived. Again the suggestion is made that the governor of Tripoli had been won over by bribes. It is supposed that ʿUbayd Allah had been able to take with him a great part of his considerable wealth, and that it was easy for him to corrupt the provincial governors. Certainly he had information of what had befallen Abu l-ʿAbbas in Kairawan. At first he retired to Kastilia, but when he made sure that there was no possibility of Abu l-ʿAbbas getting free and joining him there, he went on to Sijilmassa (Maq. ii. 11).
At the time of his arrival in this town the ruling prince, al-Yasa b. Midrar, had no grounds of suspicion, and received the travellers very kindly. ʿUbayd Allah made him valuable presents, and they soon became intimate. One day, however, as they were sitting together, a letter from Ziadat Allah was put into al-Yasa’s hand, and in it the Aghlabi related the suspicions he had formed about ʿUbayd Allah. The governor immediately ordered the arrest of ʿUbayd Allah and his son, questioned them closely about their relations with Abu l-ʿAbbas, and the suggestion that they were in some way associated with Abu ʿAbdullah, but ʿUbayd Allah denied any knowledge of either of these. The father and son were then separated and confined in separate quarters, and the son, Abu l-Kasam, was examined apart, but no information of any sort could be obtained from him.
Meanwhile, since the departure of the messengers from Abu ʿAbdullah to ʿUbayd Allah, the former had continued his career of conquest. Meila, Satif, and other towns immediately near the Katama territory were taken, and the governor at Kairawan was no longer able to disguise from himself that the Shiʿite revolt was threatening the very basis of Arab authority in Ifrikiya. Under these circumstances Ziadat Allah assembled a council of canonists to advise him about the Shiʿite claims. The meeting took place in the house of the prince’s chief adviser, Abdullah b. Essaig, and, after considering the religious character of Abu ʿAbdullah’s movement, and especially the report that “he cursed the Companions,” i.e., that he was a Shiʿite who cursed the first three Khalifs as usurpers who had excluded ʿAli from his rights, regardless of the fact that they had been the companions of the Prophet, they decided that Abu ʿAbdullah and his followers must be publicly denounced as heretics. Fortified with this decision which was necessary to stop the tendency of his own people to favour the Shiʿites, the Aghlabid assembled an army of 40,000 men whom he placed under a kinsman named Ibrahim b. Habashi b. ʿUmar at-Tamimi, and sent them against the Katama. Ibrahim took up his quarters at Konstantina l-Hawa, on the western edge of the Katama country, and there he stayed six months without actually attacking the Shiʿites, but serving as a check upon their movements. As soon as he appeared Abu ʿAbdullah retired to his usual retreat, “the house of flight,” and no further advance was made on either side. As Ahwal had already proved, this kind of patrol work was the most effective. But Ibrahim desired a decisive punishment of the revolted tribes, and rashly resolved to move out and attack Kerma, one of the cities occupied by the Shiʿites. On the way Abu ʿAbdullah met and defeated him, and he had to flee with the remnants of his army to Kairawan.
Matters were now becoming extremely serious, and Ziadat assembled a new force which he entrusted to Harun b. Tabni. Harun marched upon Daralmoluk and took it, but immediately afterwards Abu ʿAbdullah arrived with his main band, and a general engagement ensued, in which Harun was killed and his forces completely routed. After this victory Abu ʿAbdullah marched upon Banjas, which capitulated, and then was in a position to threaten Kairawan itself. We have now reached the year 295, and at this point Ziadat Allah raised a third army and took command himself. He advanced to Elaris, but there his courtiers began to remonstrate with him: if any disaster took place and he were involved it would mean the downfall of the Aghlabid dynasty, a result which would not necessarily proceed from the defeat of a subordinate general. Persuaded by his entourage Ziadat Allah appointed his kinsman Ibrahim as commander-in-chief, and himself retired to Raqada to the south-west of Kairawan, and gave himself over entirely to a life of pleasure.