Since the Ottoman conquest of Yemen in 1517, it had been known as the Yemen Eyalet. After the Tanzimat reforms in the Ottoman Empire, Yemen Vilayet was established from most of the former Eyalet in 1872. In the 1830s, aided by the collapse of the Zaidi Imamate due to internal division and the adoption of modern weaponry after the Crimean War, the Ottomans moved into northern Yemen, eventually taking San'a and making it the capital of the Yemen Vilayet in 1872. Even then, Ottoman control was largely confined to cities, and the Zaidi imam's rule over Upper Yemen was formally recognized. Starting in 1872, after the Sana'a region was firmly under control, Ahmed Muhtar Pasha set about restructuring the administration of the Yemen vilayet, dividing it into four sanjaks, with San'a' city serving as capital of the vilayet. Asir became a sanjak of Yemen in 1872. In the late 19th century, the Zaidis rebelled against the Turks, and Imam Mohammed ibn Yahya laid the foundation of a hereditary dynasty. When he died in 1904, his successor Imam Yahya ibn Mohammed led the revolt against the Turks in 1904–1905, and forced them to grant important concessions to the Zaidis. The Ottoman agreed to withdraw the civil code and restore sharia in Yemen. In 1906, the Idrisi leaders of Asir rebelled against the Ottomans. By 1910 they controlled most of Asir, but they were ultimately defeated by Turkish and Hejazi forces. Ahmet İzzet Pasha concluded a treaty with Imam Yahya in October 1911, by which he was recognised as temporal and spiritual head of the Zaidis, was given the right to appoint officials over them, and collect taxes from them. The Ottomans maintained their system of government in the Sunni-majority parts of Yemen. In March 1914, the Anglo-Turkish Treaty delimited the border between Yemen and the Aden Protectorate. When World War I broke out, Imam Yahya remained nominally loyal to the Sultan, but tried to negotiate with Britain at the same time. The Asir, on the other hand, joined Britain as soon as the war began. The Arab Revolt in Hejaz cut off Yemen from the rest of the Ottoman Empire, and the imam took the opportunity to establish his power over all of Yemen. Turkish forces withdrew in 1918, and Imam Yahya strengthened his control over northern Yemen creating the Mutawakkilite Kingdom of Yemen.