Ubaydallah ibn al-Sari

[4] Ubaydallah's rule over Egypt was initially contested by the Abbasid central government, which was still attempting to recover from the loss of authority it had incurred due to the civil war between the rival caliphs al-Amin and al-Ma'mun in 811–813, and shortly after his accession he was forced to deal with an invasion by Khalid ibn Yazid al-Shaybani, who had been delegated by al-Ma'mun to seize command of the country.

Over the next few months the two sides fought several engagements; at length Ibn al-Jarawi withdrew his support and Khalid's position became seriously degraded, and by early 823 he was finally defeated and captured by Ubaydallah.

Although al-Ma'mun had written to both men granting them the right to collect the land taxes in the areas they respectively controlled, the two sides quickly found an excuse to come into conflict with each other and war soon broke out.

[6] Ubaydallah's governorship came to an end in 826, when al-Ma'mun again sought to achieve greater effective control over the country by dispatching to it the Tahirid general Abdallah ibn Tahir.

While Ibn al-Jarawi immediately offered his submission, Ubaydallah attempted to fight off Abdallah, but his forces were defeated and he eventually decided to seek a guarantee of safety instead.