The Zaydi imamate of Yemen was one of Islam's longest-lived states. Zaydi imams had ruled parts of the Yemeni highlands since 897, chosen in theory not by birth alone but by rising with the sword as qualified descendants of the Prophet's family. Its last great dynasty began in 1597, when the first Qasimi imam, al-Mansur al-Qasim, raised the Zaydi tribes against the Ottoman Empire. His son al-Mu'ayyad Muhammad completed the work: by the mid-1630s the Ottomans had been expelled from Yemen entirely, and the imams of the Qasim line ruled the highlands from Sanaa - a dynasty of scholar-warriors whose state rested on tribal allegiance and religious prestige rather than bureaucracy.
For a century and a half the Qasimi imamate prospered on the coffee trade through the port of Mocha, but in the eighteenth and nineteenth centuries the state fractured as rival claimants multiplied and the coast slipped away. Egypt under Muhammad Ali occupied the Tihama in the 1830s, Britain took Aden in 1839, and the highland imams' authority shrank to the tribes around Sanaa.
The Ottomans returned in 1872, taking Sanaa and holding the coasts and cities for forty years against stubborn Zaydi revolts - a major rising came in 1889, and guerrilla war flared again after 1904. The struggle ended in a draw. By the Treaty of Daan in 1911 the Porte recognized Imam Yahya Hamid al-Din's authority over the Zaydi districts while keeping the coast and the administration, an arrangement that left both sides exhausted when the First World War finished the Ottoman Empire.
When the last Ottoman troops withdrew in 1918, Imam Yahya re-established the imamate over all of highland Yemen as the Mutawakkilite Kingdom - Mutawakkil, 'relying on God,' was his regnal title. He ruled from Sanaa a deliberately sealed kingdom: few roads, no banks, foreign visitors rare and suspect, the state's business conducted by the imam, his sons, and the great sayyid families. It was in many ways the state of his Qasimi ancestors preserved - tribal, highland, austere - and its isolation was at once its strength and its danger.
Disputes multiplied on every frontier. With Britain the quarrel was the Aden protectorates, whose frontier with the imamate was never settled. To the north Yahya claimed the territories of the Idrisi ruler of Asir, and from the desert pressed the growing power of Abd al-Aziz ibn Saud, whose ambitions met Yemen's along ill-defined tribal boundaries. The imam claimed authority over all of historic Yemen; his neighbors had other ideas, and the answers would be written in war.
By 1924 the Mutawakkilite kingdom stood alone: a Zaydi imamate that had outlasted the Ottomans, armed and unbeaten, but sealed off from the currents reshaping the Arab world around it. Its coffers depended on customs duties and tribal tribute, its army on highland levies, its legitimacy on the imam's person. Yemen would hold to Yahya's austere course for another generation, until the pressures gathering beyond its borders finally broke in.