One of the earliest and most prominent members of al-Mu'tasim's Turkic guard, he rose to become one of the leading figures of the empire under al-Mu'tasim, serving as a commander in the Amorium campaign, and playing a leading role in the purge of the old Abbasid elites that followed. He was also governor of Egypt from 834, as well as of the Levant and Upper Mesopotamia from 838 on, although in practice he appointed deputies to govern in his stead. Under al-Mu'tasim's successor al-Wathiq, his powers were extended further into a virtual viceroyalty over all western provinces of the caliphate.