and Bakbak thereafter treated the young Ahmad as his own son. The young Ahmad ibn Tulun received a thorough education, involving military training at the new Abbasid capital of Samarra and studies in Islamic theology at Tarsus, acquiring a reputation not only for his knowledge but also for his pious and ascetic way of life. He became popular among his fellow Turks, who would confide secrets and entrust their money and even their women to him. While at Tarsus, Ibn Tulun fought in the frontier wars with the Byzantine Empire. There he also met another senior Turkish leader, Yarjukh, whose daughter, variously given as Majur or Khatun, became his first wife and the mother of his eldest son, Abbas, and his daughter Fatimah. The sources also report that during his time at Tarsus, Ibn Tulun had ties to Caliph al-Mutawakkil's vizier Ubayd Allah ibn Yahya ibn Khaqan, and the latter's cousin Ahmad ibn Muhammad ibn Khaqan. On one occasion, while returning to Samarra, he saved a caravan bearing a caliphal envoy returning from Constantinople from a Bedouin raiding party, and accompanied it to Samarra. This act gained him the favour of Caliph al-Musta'in (), as well as a thousand gold dinars and the hand of the slave Miyas, the mother of his second son, Khumarawayh. When the Caliph abdicated and went into exile at Wasit in 866, he chose Ibn Tulun to be his guard. Qubayha, the mother of the new caliph, al-Mu'tazz (), schemed to remove the deposed al-Musta'in, and offered Ibn Tulun the governorship of Wasit if he would murder him. Ibn Tulun refused and was replaced by another, who carried out the deed. Ibn Tulun himself played no part in the assassination, but gave his master a burial and returned to Samarra. Governor of Egypt Already under Caliph al-Mu'tasim, senior Turkish leaders began being appointed as governors of provinces of the Caliphate as a form of appanage. Thereby they secured immediate access to the province's tax revenue for themselves and their troops, bypassing the civilian bureaucracy. The Turkish generals usually remained close to the centre of power in Samarra, sending deputies to govern in their name. Thus when al-Mu'tazz gave Bakbak charge of Egypt in 868, Bakbak in turn sent his stepson Ahmad as his lieutenant and resident governor. Ahmad ibn Tulun entered Egypt on 27 August 868, and the Egyptian capital, Fustat, on 15 September. Ibn