The Battle of Mecca was an armed skirmish fought in 883 between the forces of the Tulunid ruler of Egypt and Syria, Ahmad ibn Tulun, and those of the Abbasid Caliphate, supported by the Saffarid emirate. The battle took place at Mecca in western Arabia and was fought to determine who would gain guardianship over the city during the hajj. It ended with an Abbasid-Saffarid victory and the expulsion of the Tulunid forces from Mecca.

Background

Ahmad ibn Tulun, a Turkish soldier in the service of the Abbasids, had been appointed governor of Egypt in 868. Over the course of the next several years he took advantage of the instability of the Abbasid central government and managed to turn Egypt into a strong power base for himself, gaining absolute mastery over its administration and significantly improving its fiscal situation. As Ibn Tulun grew increasingly entrenched in his governorship he continued to acknowledge the suzerainty of the Abbasid caliph al-Mu'tamid, but at the same time he gradually became a de facto autonomous amir in his own right, backed by his own personal army that he had built and the large stream of revenues that Egypt provided him.

Battle of Mecca (883)

Ibn Tulun's power soon made him a major rival to the effective ruler of the Abbasid state, al-Mu'tamid's brother and regent al-Muwaffaq, and in 877 the latter sent an army on an abortive campaign to oust Ibn Tulun from Egypt. In the following year Ibn Tulun extralegally seized control of Syria and other territories up to the border zone with the Byzantine Empire, creating further conflict with the Abbasid regent, and an unsuccessful attempt in 882 by al-Mu'tamid to escape from his brother's control by fleeing to the court of Ibn Tulun caused a complete breach in relations. In the aftermath of the caliph's flight, al-Muwaffaq ordered that Ibn Tulun be publicly cursed in mosques throughout the empire and de jure dismissed him from his governorships, while Ibn Tulun similarly had al-Muwaffaq publicly cursed, declared him deposed from his position as al-Mu'tamid's second heir and proclaimed a "holy war" against him.

Battle of Mecca (883)

Tulunid designs on Mecca

As Ibn Tulun's relations with the Abbasid government deteriorated, he began to turn his attention to the city of Mecca in western Arabia. As one of the Holy Cities of Islam, Mecca carried with it a significant amount of symbolic prestige, and leadership of the annual hajj or pilgrimage was considered a major source of legitimacy for the caliphs. By claiming the rights of guardianship over Mecca, Ibn Tulun likely hoped to secure greater political appeal for himself throughout the Muslim world, and in the process improve his standing with the Abbasid court.

Battle of Mecca (883)

Any attempt by Ibn Tulun to lay claim to Mecca, however, was bound to stir up hostility against him. Not only would such a move be naturally opposed by al-Muwaffaq, but it would also create conflict with 'Amr ibn al-Layth, the powerful Saffarid governor of Sijistan and much of the Islamic East, who had been assigned various responsibilities over the pilgrimage and the Holy Cities. As with Ibn Tulun, 'Amr enjoyed a high degree of independence from the Abbasid government, but unlike the Egyptian ruler he was on relatively cordial terms with the caliphal court during this period, and in regards to Mecca he proved to be particularly jealous to preserve his own rights in the city.

Despite these obstacles, Ibn Tulun had made an initial attempt to establish himself in Mecca in 881, when he sent an agent with a detachment of cavalrymen to represent his interests there. Upon their arrival, however, they found themselves opposed by troops loyal to 'Amr, and the two sides began to quarrel over the issue of whose master's banner would be placed to the right of the minbar in the Great Mosque. Both factions drew swords over the matter, and a battle was narrowly averted only by the intervention of the Abbasid governor of Mecca Harun ibn Muhammad ibn Ishaq al-Hashimi, who deployed his Zanj troops in support of the Saffarid side. 'Amr's representative was therefore able to act as he wished, and his banner was allowed to remain in the place of honor beside the pulpit.