When Yaḥyā was a child, Yemen was a province of the Ottoman Empire. His youth was spent in the service of his father’s administration, and, when his father died in 1904, Yaḥyā succeeded him as imāmimam. The Yemenis had always resented Turkish rule, and Yaḥyā was soon able to assemble a potent military force. Sporadic warfare lasted until 1911, when he was able to force the Turks to recognize the autonomy of his personal rule over the Yemen. He remained loyal to the Turks when World War I broke out but did not take an active part in the hostilities. At the close of the war he was recognized as the independent ruler of the Yemen, but there was no agreement on just which territories composed the country.

Yaḥyā clashed with the British, who had a military base in Aden and who considered many of the neighbouring tribes to be under their protection. He also clashed with his Arab neighbours along the Red Sea coast in the province of Asir. War with the Saudis broke out in 1934, just after the conclusion of the treaty with Great Britain, and Yaḥyā suffered a decisive defeat. King Ibn Saʿūd was generous, ; he forced the imāmimam to make no territorial concessions , and permitted a reversion to the prewar status quo. Thereafter foreign affairs ceased to be a dominant concern, and Yaḥyā directed his attention mostly to stabilization at home.

The hallmark of his rule was isolation from the outside world. His military power was based on the support of the Zaydī tribesmen of the interior highlands, while he administered the country through a small class of nobles known as sayyids. Yaḥyā himself secured what amounted to a monopoly of Yemen’s foreign trade. He was most concerned that no foreign influences disrupt this delicate equilibrium. He received some economic and military aid from the Italians in the 1920s and ’30s but firmly refused close contacts, such as an exchange of diplomatic missions. During World War II he remained neutral, but trouble began afterward, when the British strengthened their position in Aden and Yemenis who were discontented with Yaḥyā’s isolationist autocracy looked to them for support. Yemenis abroad also supported the domestic dissidents, but opposition did not become active until 1946. Two years later , the aged imām was machine-gunned to deathimam was assassinated.