Tulun's position after his appointment was far from undisputed within his province. As governor of Fustat he oversaw the province's garrison and was the head of the Muslim community as recognized in his title of 'overseer of the army and the Friday prayer' (), but the fiscal administration, in particular the collection of the land tax () was in the hands of the powerful veteran administrator Ibn al-Mudabbir. The latter had been appointed as fiscal agent () already since , and had rapidly become the most hated man in the country as he doubled the taxes and imposed new ones on Muslims and non-Muslims alike. Ibn Tulun quickly signalled his intention to be sole master of his province: on his arrival at Fustat, when both Ibn al-Mudabbir and Shukayr, the head of the postal service () and of correspondence with the caliphal government, came out to meet him with a gift of 10,000 dinars, he refused to accept it. For the next four years, Ibn Tulun and his rivals fought via their emissaries and relatives at the caliphal court in Samarra to neutralize each other; in the end, Ibn Tulun managed to secure Ibn al-Mudabbir's transfer to Syria in July 871, and assumed collection of the himself. At the same time, Ibn Tulun also secured the dismissal of Shukayr, who died shortly after. Thus by 872 Ibn Tulun had assumed control of all branches of the administration in Egypt, becoming de facto independent of the Abbasid central government. At the time of Ibn Tulun's appointment, Egypt was undergoing a transformative process. In 834 its early Muslim elite, the Arab settler families () of Fustat, lost their privileges and government pay, and power passed to officials sent by the Abbasid court. At about the same time, for the first time the Muslim population began surpassing the Coptic Christians in numbers, and the rural districts were increasingly subject to both Arabization and Islamization. The rapidity of this process, and the influx of settlers after the discovery of gold and emerald mines at Aswan, meant that Upper Egypt in particular was only superficially controlled by the local governor. Furthermore, the persistence of internecine strife and turmoil at the heart of the Abbasid state—the so-called "Anarchy at Samarra"—led to the appearance of millennialist revolutionary movements in the province under a series of Alid pretenders. One of them was Ibn al-Sufi, a descendant of Ali's