The five-storey palace was constructed as a summer residence for Imam Yahya in the 1930s, but it seems that he was building atop a preexisting structure that was built in the 1700s by an Islamic scholar.
Dar al-Hajar itself is built like a fortress, with shooting emplacements to defend the place from attackers. The palace also has its own water supply from deep below the rock and could, therefore, have easily withstood a siege.
Yahya Muhammad Hamid ed-Din was born 1869 in Sanaa into the Hamidaddin branch of the al-Qasimi dynasty who ruled most of Yemen proper and South Saudi Arabia today for over 900 years.
Upon the death of his father in 1904, Yahya became Imam, effectively ruler over the mountainous areas of the future North Yemen. However, the Ottomans who made claim on the area did not recognize the rule of the Imams of Yemen since their entry into Yemen.