Although supported by the Ahnumi tribesmen, al-Qasim's first years of struggle were difficult. Strong action by the Ottoman forces reduced the imam to despair by 1604. Then, however, the
emir of the important stronghold
Hajjah in the western mountains chose to support al-Qasim. From this point the forces of the imamate held the initiative. In 1607 the Ottoman governor Sinan made an agreement with al-Qasim, where the latter was granted possession of the areas in the northern highlands which he had subdued. Infighting among the Turkish administrators in 1613 left the north of the country exposed to the forces of the imam, and the important city
Sa'dah fell in 1617. Two years later a new truce was concluded that confirmed the expanded realm of al-Qasim. By this time he controlled the entire area between
Sana'a and Sa'dah. When he died in 1620, the city of San'a and the coastal region
Tihamah were still in Ottoman hands. It was left to his son and successor
al-Mu'ayyad Muhammad (r. 1620–1644) to expel them entirely. By this time the Yemenis possessed firearms which, together with the poor quality of local Ottoman soldiery and strong local discontent with taxation, ensured military successes against the occupiers. Although the Zaidi imamate is not strictly speaking hereditary, but depends on the qualifications and
Sayyid ancestry of the claimant, al-Mansur al-Qasim actually founded a dynasty, known after him as the
Qasimids. ==See also==