The Tulunids (الطولونيون), were a Mamluk dynasty of Turkic origin who were the first independent dynasty to rule Egypt, as well as much of Syria, since the Ptolemaic dynasty. They were independent from 868, when they broke away from the central authority of the Abbasid Caliphate, to 905, when the Abbasids restored the Tulunid domains to their control. In the late 9th century, internal conflict amongst the Abbasids made control of the outlying areas of the empire was increasingly tenuous, and in 868 the Turkic officer Ahmad ibn Tulun established himself as an independent governor of Egypt. He subsequently achieved nominal autonomy from the central Abbasid government. During his reign (868–884) and those of his successors, the Tulunid domains were expanded to include Jordan Rift Valley, as well as Hejaz, Cyprus and Crete. Ahmad was succeeded by his son Khumarawayh, whose military and diplomatic achievements made him a major player in the Middle Eastern political stage. The Abbasids affirmed their recognition of the Tulunids as legitimate rulers, and the dynasty's status as vassals to the caliphate. After Khumarawayh's death, his successor emirs were ineffectual rulers, allowing their Turkic and black slave-soldiers to run the affairs of the state. In 905, the Tulunids were unable to resist an invasion by the Abbasid troops, who restored direct caliphal rule in Syria and Egypt. The Tulunid period was marked by economic and administrative reforms alongside cultural ones. Ahmad ibn Tulun changed the taxation system and aligned himself with the merchant community. He also established the Tulunid army. The capital was moved from Fustat to al-Qata'i, where the celebrated mosque of Ibn Tulun was constructed. The rise and fall of the Tulunids occurred against a backdrop of increasing regionalism in the Muslim world. The Abbasid caliphate was struggling with political disturbances and losing its aura of universal legitimacy. There had previously been Coptic and Shia Alid-led movements in Egypt and Baghdad, without more than temporary and local success.