His first tenure as governor of Egypt was short, lasting from April to September 816, but he was reappointed to the post in March 817 and held it until his death in November 820. He was succeeded by his sons as nominal governors of the province. The north remained under Abd al-Aziz's son Ali (Abd al-Aziz also died in 820), and a first Abbasid attempt at recovering control over the province by sending Khalid ibn Yazid al-Shaybani in 822 was thwarted.