Career
Ali himself appears first in 779/80. under Caliph al-Mahdi (775–785), as commander of the caliphal guard (ḥaras). He then served as commander of the guard of the heir al-Hadi (r 785–786), and continued in the post after the latter"s accession. Under al-Hadi, he also occupied the posts of secretary of the army department (diwan al-jund), the powerful post of chamberlain (hajib) and director of the treasures.
Under Harun al-Rashid (r 786–809) he continued to serve as commander of the guard until 796, when he was named governor of Khurasan, a move opposed by Yahya al-Barmaki.
As a leader of the abna′ al-dawla, the troops that formed the core of the Abbasid army in Iraq, he antagonized the Khurasanis and oppressed them through heavy taxation, with the revenue diverted for the upkeep of the abna′ and for filling his own coffers. During his eight-year tenure, he amassed a vast fortune.
This resulted in the outbreak of a major rebellion under Rafi ibn al-Layth, which eventually required the personal intervention of Harun al-Rashid in 808. Replaced by Harthama ibn A"yan and disgraced, Ali rose again to prominence after the death of Harun in March 809.
As many of the Baghdadi elites, he was a strong supporter of the new Caliph, al-Amin (r 809–813), who honoured him with the appelation shaykh hadhihi"l-dawla and put him in charge of the affairs of his own heir, Musa.
At the head of a huge army of reportedly 50,000 men drawn from the abna′, Ali marched east, but in the Battle of Rayy on 3 July 811 he was crushingly defeated and killed by a far smaller army of al-Ma"mun under Tahir ibn al-Husayn. Another son, al-Husayn, also served in Sistan during Ali"s governorship of Khurasan, and suppressed an anti-Abbasid rebellion and recruited troops in Syria in 811/2. With the advance of al-Ma"mun"s troops, which led to the Siege of Baghdad (812–813), al-Husayn briefly imprisoned al-Amin and tried to rouse the citizens of Baghdad to switch their allegiance to al-Ma"mun, but failed and was killed.