He himself first appears in 815,[1] when he was an officer serving among forces loyal to al-Hasan ibn Sahl in southern Iraq, during the tumultuous period in the aftermath of the civil war between the rival caliphs al-Amin (r. 809–813) and al-Ma'mun (r. 813–833).
Following the death of the pro-Alid rebel Abu al-Saraya al-Sirri in late 815, Hamdawayh was appointed by al-Hasan as governor of the Yemen, which was then in the hands of the Alid Ibrahim ibn Musa al-Jazzar, and tasked with recovering the province for al-Ma'mun.
When Ibrahim marched toward Sana'a in 818, Hamdawayh went out to meet him with his army, and in a sharp engagement defeated the Alid and killed a large number of his men.
[3] Hamdawayh's rule in the Yemen lasted until 820, when al-Ma'mun appointed Isa ibn Yazid al-Juludi as governor of the province.
This area subsequently remained under the control of the Ziyadid dynasty, and the authority of succeeding governors of Yemen proper was restricted to Sana'a and the highlands of the country.