Meanwhile Abu ʿAbdullah was extending his authority over the whole country. He was invited to Bagaya which he occupied, then took by force the small towns of Majana, Sash, and Maskanaya. His politic clemency at Bagaya produced a good impression, and did much to assist him in gaining over other towns. His success caused great alarm to Ziadat Allah, and he consulted ʿAbdullah b. Essaig, who advised him to retire to Egypt and leave a general in charge of the army, but Ibrahim persuaded him to abandon this idea. Soon afterwards Abu ʿAbdullah advanced to Merida, where were many refugees from the towns already taken. The inhabitants asked for terms, and Abu ʿAbdullah’s lieutenants agreed, the leader himself being absent. When the envoys from the citizens returned and the gates were opened to admit them, the attacking army made a sudden rush, forced their way in, and pillaged the city.
Abu ʿAbdullah now resolved to attack Raqada where Ziadat Allah was established. As he marched towards that town Ibrahim tried to intercept him, and for this purpose left al-Arbes where he was encamped, and occupied Derdemin, which lay near the route which Abu ʿAbdullah would have to take. On his way the Shiʿites sent a detachment to take Derdemin, without apparently being aware that this was now Ibrahim’s headquarters. The detachment was repulsed and put to flight. Abu ʿAbdullah was unable to understand why the detachment did not return, and went after them with reinforcements to find out. On the way they met their comrades in full flight from Derdemin, but at their arrival the fugitives stopped, turned back, and with the help of the new-comers inflicted a severe defeat on Ibrahim. This was followed by the submission of Qafra and Qastilia, the latter place being a general depot for Ziadat Allah’s munitions, provisions, and money, all of which fell into the Shiʿites’ hands. For the moment, however, Abu ʿAbdullah refrained from further advance: he settled at Bagaya and established his headquarters there, and then retired for a time on his own account to Mount Ankijan.
Ibrahim then decided to take the offensive and laid siege to Bagaya, news of which quickly brought Abu ʿAbdullah back from his retirement, bringing 12,000 newly enrolled tribesmen with him. But Bagaya was offering such a sturdy resistance to Ibrahim that the besieger was both astonished and discouraged, and, hearing of Abu ʿAbdullah’s approach, retired again to al-Arbes.
In the spring of the following year, A.H. 296, the two armies of Ziadat Allah and Abu ʿAbdullah both took the field. The historians state that the former numbered 200,000 men, the latter many more. It must, of course, be remembered that figures of this sort by oriental writers are hardly deserving of the least attention. An engagement took place with results unfavourable to Ibrahim, who forthwith retired to Kairawan, the strongest military stronghold in Africa. As a consequence of this Abu ʿAbdullah was enabled to enter al-Arbes, and a great massacre of the inhabitants took place, some 3,000 it is said being killed in the principal mosque. The following morning Abu ʿAbdullah retired to Bagaya. Next day the news reached Ziadat Allah. For some time ʿAbdullah b. Essaig endeavoured to conceal it from the citizens, but when he offered 20 dinars to each volunteer willing to serve in the cavalry, and 10 dinars to each recruit for the infantry, the citizens perceived that the state was reduced to the last extremities and a panic ensued, many of the nobles and their dependents leaving for Raqada. Ziadat Allah himself packed up his valuables, and with the favourite ladies of his harim set out for Egypt. ʿAbdullah b. Essaig was put in charge of the prince’s goods, and these were loaded on thirty camels, but unfortunately they missed their way as they started in the dark, and arrived at Susa where the governor impounded them, and they finally fell a prey to Abu ʿAbdullah. ʿAbdullah b. Essaig himself tried to escape by sea, but a storm drove his ship ashore at Tripoli just as Ziadat Allah, angry at missing his goods, was stopping there. The unfortunate minister was brought before the prince as a deserter, but made so good a defence that Ziadat Allah decided to pardon him; the courtiers, however, intervened, and he was beheaded.
After reaching Egypt, Ziadat Allah passed on to Rakka and sent forward messengers to the Khalif asking permission to present himself at Baghdad. A reply came forbidding him to attend at court and ordering him to await further instructions at Rakka. He stayed there a whole year which he spent in pleasure, and then received instructions to return to Africa, the governor of Egypt being directed to prepare supplies to equip him for an expedition against the Shiʿites. In accordance with these orders he travelled back to Egypt, where the governor told him to wait for the supplies at Dhatu l-Hammam. He waited there a long time in vain, and then, as he was now in broken health he started out for Palestine, but was taken worse on the way and died at Ramla. With him the Aghlabid dynasty of hereditary governors of Ifrikiya, under the ʿAbbasid Khalifate, came to an end.
When Abu ʿAbdullah heard of the Emir’s flight he went at once to Wady an-Namal, and sent forward 1,000 men under Arunaba b. Yusus and Hasan b. Jarir to Raqada. The news soon reached Kairawan, and a deputation was sent out to congratulate the Shiʿites. These emissaries thought to ingratiate themselves by making contemptuous and hostile reflections upon the late ruler, but Abu ʿAbdullah rebuked them, stating that Ziadat Allah had lacked neither courage nor intelligence, but that defeat had overtaken him because it was the will of God. His gracious reception of the envoys from Kairawan caused great annoyance to the Katama tribesmen, to whom he had made a promise that they would be allowed to plunder the city.
In Rajab I. 296 Abu ʿAbdullah, at the head of 300,000 men, entered Raqada to find the town entirely deserted by its inhabitants. He established himself in one of the empty mansions, and the leaders of the Katama occupied others (Maq. ii. 11). He then sent to Tripoli to fetch his brother Abu l-ʿAbbas and Abu Jaʿfar, as well as ʿUbayd Allah’s mother, who had apparently accompanied her son, though we hear no more about her. Abu ʿAbdullah was a fervent Shiʿite and established a strict puritan rule in Kairawan, death being the penalty for drinking wine or bringing it into the city. The Shiʿite formula was used in the call to prayer, which implied the addition of the words “come to the excellent work” to the orthodox call, and the names of ʿAli, Fatima, Hasan, and Husayn were inserted in the Khutba or public prayer at the Friday service. As in modern Persia the supreme authority was attributed to the concealed Imam, and the civil government based its rights on the claim to act as his deputy until the day of his revealing. In Kairawan the proper deputy would naturally be the Mahdi ʿUbayd Allah, but no public announcement was made of this as yet. The Khatibs of Kairawan and Raqada were ordered to omit the name of the ʿAbbasid Khalif from the khutba, but no other ruler’s name was inserted in its place. A new coinage was prepared, and this similarly bore no prince’s name; simply it had the inscription on one side, “I have borne my witness to God,” and on the other “May the enemies of God be scattered.”
During these events ʿUbayd Allah remained still imprisoned at Sijalmasa, but now the time had arrived for his supporters to rescue him. Abu ʿAbdullah’s two brothers, Abu l-ʿAbbas and Abu Zakir, who had hitherto taken no very prominent position, were left as deputies at Raqada, and Abu ʿAbdullah with a large body of followers marched towards Sijalmasa. The object most desired was of course the liberation of ʿUbayd Allah, and the danger was that the governor might put him and his son to death before the Shiʿites could rescue them. It was necessary, therefore, to avoid irritating al-Yasa the governor. Abu ʿAbdullah halted his army at some distance from the city, and sent forward envoys bearing a letter in which he assured al-Yasa that he desired no conflict, but only asked that ʿUbayd Allah and his son might be set free. Al-Yasa only threw the letter on the ground and had the envoys put to death. A second letter produced a similar result, and then Abu ʿAbdullah advanced and camped his men before the city, intending to make an attack on the following day. During the night al-Yasa escaped with all his portable goods and relatives. Next morning the inhabitants sent out and informed Abu ʿAbdullah, who went at once to the prison whence he liberated ʿUbayd Allah and his son. Leading the Mahdi out he showed him to the people, saying: “This is the Mahdi to whose obedience I invited men.” He then set him and his son on horses and paraded them through the streets, crying, “This is your lord,” frequently interrupting his cry with tears of joy. He conducted them to a tent which had been made ready for them, and sent a body of men in pursuit of al-Yasa (Maq. ii. 11-12). The fugitive governor was overtaken, brought back, and executed.
Ibn Khallikan gives another account of the taking of Sijalmasa, in which it is related that, before leaving the city al-Yasa executed ʿUbayd Allah, and when Abu ʿAbdullah entered his cell he found only the dead body and a faithful Jewish slave. Knowing that the absence of the Mahdi would be fatal to the whole Shiʿite scheme, he seized the slave, compelled him to silent acquiescence, and leading him out declared, “This is the Mahdi” (Ibn Khall. ii. 78). This is another form of the “Jewish legend,” to which we have already referred (cf. [p. 47, above]).
For forty days ʿUbayd Allah remained at Sijalmasa, and then, towards the end of Rabiʿ II. 297 he was conducted by Abu ʿAbdullah to Raqada. Here he assumed the title of “al-Mahdi, Commander of the Faithful,” and on the following Friday was prayed for under that title in the mosques of Raqada and Kairawan. On the same day the Sherif and the duʿat held a public meeting, at which they tried to persuade the people of Raqada to become professed members of the Ismaʿilian sect. In this, however, they were only partially successful, although lavish rewards were offered to those who joined, and many of those who definitely refused were imprisoned, some even put to death. In fact we are now in quite different surroundings: the Mahdi was a successful adventurer, and had every prospect of establishing a principality quite as stable, and more independent than that of the Aghlabids: the religious pretensions of the Shiʿite party were only an embarrassment. From this time forward the Ismaʿilian sectaries form a privileged class, on the whole disliked and despised by the people generally, who were quite ready to submit to the Mahdi’s government, though deriding its spiritual claims; and the tendency is for the ruler rather to disembarrass himself of the sectaries.