although muhammad ali had only been granted the title of wali, he proclaimed himself khedive, or hereditary viceroy, early on during his rule. the ottoman government, although irritated, did nothing until muhammad ali invaded ottoman-ruled syria in 1831. the governorship of syria had been promised him by the sultan, mahmud ii, for his assistance during the greek war of independence, but the title was not granted to him after the war. this caused the ottomans, allied with the british, to counter-attack in 1839.