The Zaydi tribesmen in the northern highlands, particularly those of Hashid and Bakil, constantly resisted Turkish rule in Arabia.
Al-Mansur al-Qasim proclaimed the Imamate in September 1597, which was the same year the Ottoman authorities inaugurated al-Bakiriyya Mosque.
[5] When Imam al-Mansur al-Qasim died in 1620 his son Al-Mu'ayyad Muhammad succeeded him and confirmed the truce with the Ottomans.
He was succeeded by Al-Mutawakkil Isma'il, another son of al-Mansur al-Qasim, who conquered Yemen in its entirety, from Asir in the north to Dhofar in the east.
[16] Seven contenders claimed the succession after him in a period of only three years; of these, al-Mahdi Muhammad finally gained power in 1689 after a violent struggle.
[17][18] The imamate did not follow a cohesive mechanism for succession, and family quarrels and tribal insubordination led to the political decline of the Qasimi dynasty in the 18th century.
The rising power of the fervently Islamist Wahhabi movement on the Arabian Peninsula cost the Zaidi state its coastal possessions after 1803 CE.
The imam was able to regain them temporarily in 1818, but new intervention by the Ottoman viceroy of Egypt in 1833 again wrested the coast from the ruler in Sana'a.
[23] The country established diplomatic relations with the Safavid dynasty of Persia, the Ottomans of Hejaz, the Mughal Empire in India and Ethiopia.