Background
Ali bin Muhammad al-Hosni was born in the village al-Ahani in the Sa'dah area in northern Yemen. He was not closely related to the recent imams, but an 11th-generation descendant of the imam ad-Da'i Yusuf.
Ali bin Muhammad al-Hosni was born in the village al-Ahani in the Sa'dah area in northern Yemen. He was not closely related to the recent imams, but an 11th-generation descendant of the imam ad-Da'i Yusuf.
The Yemeni imamate in the highlands was often contested by rival claimants in this era. As a young man, Ali received a good deal of instruction in the religious sciences. In 1346, the learned and powerful Imam al-Mu'ayyad Yahya died, and no politically strong figure emerged in his stead.
Under these circumstances, Ali rose to power from his base in the mountain fortress Thula in 1349. Al-Mahdi Ali laid siege to the city. However, the brothers held firm and after six months he had to lift the siege and return to Thula.
During his 23 years long reign, al-Mahdi Ali was nevertheless able to amass considerable political influence in Yemen. The powerful Rasulid Dynasty ruled the lowlands, but its grip on the northern inland had been shattered since some time. The Rasulid emir of Hadar, Nur ad-Din Muhammad bin Mika'il, turned rebellious against Sultan al-Mujahid Ali in 1359.
Nur ad-Din entertained plans to take over the sultanate. Al-Mahdi Ali bestowed the fortress Miftah as an appanage, and the rebel resided there until his demise in 1377. Al-Mahdi Ali himself died in Dhamar in 1372, after his authority had begun to recede.
His body was carried to Sa'dah to be buried there.