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.
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.
Not only would such a move be naturally opposed by al-Muwaffaq,[6] 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.
The ensuing battle, which took place in the hollow of Mecca, ended in a victory for the government forces, who killed two hundred of Ibn Tulun's men and compelled the remainder to flee to the surrounding hills.