Qasimid State

The Qasimid State (الدولة القاسمية), also known as the Zaidi Imamate, was a Zaidi-ruled independent state in the Greater Yemen region, which was founded by Imam al-Mansur al-Qasim in 1597 and absorbed much of the Ottoman-ruled Yemen Eyalet by 1628 and completely expelled the Ottomans from Yemen by 1638. The Qasimid State continued to exist into 18th and 19th century, but gradually fractured into separate small states. The most notable of those states was the Sultanate of Lahej; most of those states (except Lahej) were submitted by the Ottomans and incorporated into the restored Ottoman province of Yemen Eyalet in 1849.

Background
The Zaydi tribesmen in the northern highlands, particularly those of Hashid and Bakil, constantly resisted Turkish rule in Arabia. Justifying their presence in Yemen as a triumph for Islam, the Ottomans accused the Zaydis of being infidels. Hassan Pasha was appointed governor of Yemen, which enjoyed a period of relative peace from 1585 to 1597. Pupils of al-Mansur al-Qasim suggested that he claim the imamate and fight the Turks. He declined at first but was infuriated by the promotion of the Hanafi school of jurisprudence at the expense of Zaydi Islam.

Proclamation and expansion
Al-Mansur al-Qasim proclaimed the Imamate in September 1597, which was the same year the Ottoman authorities inaugurated al-Bakiriyya Mosque. By 1608, Imam al-Mansur (the victorious) regained control over the highlands and signed a 10-year truce with the Ottomans. When Imam al-Mansur al-Qasim died in 1620 his son Al-Mu'ayyad Muhammad succeeded him and confirmed the truce with the Ottomans. In 1627, the Ottomans lost Aden and Lahej. 'Abdin Pasha was ordered to suppress the rebels but failed and had to retreat to Mocha. After Al-Mu'ayyad Muhammad expelled the Ottomans from Sana'a in 1628, only Zabid and Mocha remained under Ottoman possession. Al-Mu'ayyad Muhammad captured Zabid in 1634 and allowed the Ottomans to leave Mocha peacefully. The reasons behind Al-Mu'ayyad Muhammad's success were the tribes' possession of firearms and the fact that they were unified behind him.

In 1632 CE, Al-Mu'ayyad Muhammad sent an expeditionary force of 1000 men to conquer Mecca. The army entered the city in triumph and killed its governor. The Ottomans were not ready to lose Mecca after Yemen, so they sent an army from Egypt to fight the Yemenites. Seeing that the Turkish army was too numerous to overcome, the Yemeni army retreated to a valley outside Mecca. Ottoman troops attacked the Yemenis by hiding at the wells that supplied them with water. This plan proceeded successfully, causing the Yemenis over 200 casualties, most from thirst. The tribesmen eventually surrendered and returned to Yemen.

By 1636, the Zaydi tribesmen had driven the Ottomans out of the country completely.

Al-Mu'ayyad Muhammad died in 1644. 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.

Consolidation (17th-18th centuries)
During Al-Mutawakkil Isma'il reign and that of his successor, Al-Mahdi Ahmad (1676–1681), the Imamate implemented some of the harshest discriminatory laws (ghiyar) against the Jews of Yemen, which culminated in the expulsion of all Jews to a hot and arid region in the Tihama coastal plain. The Qasimid state was the strongest Zaydi state to ever exist.

At the death of the imam in 1681, his son Muhammad was prevented from assuming the imamate due to counter-claims by relatives in Rada, Shaharah, Sa'dah and Mansura. Through mediation of the Ulama (religious scholars), one of these, al-Mu'ayyad Muhammad II, took power.

Al-Mu'ayyad Muhammad II was not a warlike leader, but rather an ascetic and deeply religious personality who was devoted to learning. The well-known scholar and writer Muhammad ash-Shawkani considered him one of the most righteous imams. He died in 1686 in Hamman Ali in the Anis region, possibly from poisoning. The deceased imam was buried in Jabal Dawran, at the side of his father. 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.

Decline and partition (18th-19th centuries)
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.

In 1728 or 1731 the chief representative of Lahej declared himself an independent Sultan in defiance of the Qasimid Dynasty and conquered Aden thus establishing the Sultanate of Lahej. In 1740 the 'Abdali sultan of Lahej became completely independent. It became independent thanks to the fracturing of the Zaidi State in north Yemen. The Sultanate of Lahej became an independent entity, from 1728 to 1839.

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. After 1835 the imamate changed hands with great frequency and some imams were assassinated. After 1849 the Zaidi polity descended into chaos that lasted for decades.

Economy
During that period, Yemen was the sole coffee producer in the world. The country established diplomatic relations with the Safavid dynasty of Persia, the Ottomans of Hejaz, the Mughal Empire in India and Ethiopia. The Fasilides of Ethiopia sent three diplomatic missions to Yemen, but the relations did not develop into a political alliance as Fasilides had hoped, due to the rise of powerful feudalists in the country. In the first half of the 18th century, the Europeans broke Yemen's monopoly on coffee by smuggling out coffee trees and cultivating them in their own colonies in the East Indies, East Africa, the West Indies and Latin America.