An Arab named Ali ibn Mahdi al-Himyari, native of the Yemeni Highlands, founded the Mahdid dynasty in Tihama. Ibn Mahdi and his followers burned down several districts north of Zabid. He had sworn to bring the Abyssinians back to slavery and ordered his men to kill everyone including the handicapped. Out of desperation, the people of Zabid sought assistance from the Zaydi imam Ahmed ibn Sulayman against al-Himyari. The Zaydi imam ordered Fatiq III to be executed on account of his alleged homosexuality. Fatiq III was either killed by the Imam, the Mahdids, or his own soldiers. With this event, the slave dynasty came an end and the Mahdids took over Zabid in 1158.