He managed to expel the Ottoman Turks entirely from the Yemenite lands, thus confirming an independent Zaidi state.
Al-Hasan, however, found means to win the confidence of the locals through reforms, and was appointed governor on behalf of the imam.
The governor Haydar Pasha agreed, and on 9 March 1629 he handed over the keys to San'a to the imam's son Ali.
The Turks withdrew to the coast under the imam's protection, and another son, Yahya, was made governor (amil) of San'a.
[3] Al-Mu'ayyad Muhammad spent most of his reign fighting the Ottomans, as well as bringing a degree of unity among the various tribal groups of Yemen.
[5] At his death, al-Mu'ayyad Muhammad was succeeded by his brother al-Mutawakkil Isma'il, though not without fraternal strife among contenders.