Lacking direction from the Ottoman government, Tripoli lapsed into a period of military anarchy during which coup followed coup and few deys survived in office more than a year. One such coup was led by Turkish officer Ahmed Karamanli. The Karamanlis ruled from 1711 until 1835 mainly in Tripolitania, and had influence in Cyrenaica and Fezzan as well by the mid-18th century. Ahmed's successors proved to be less capable than himself, however, the region's delicate balance of power allowed the Karamanli. The 1793–95 Tripolitanian civil war occurred in those years. In 1793, Turkish officer Ali Pasha deposed Hamet Karamanli and briefly restored Tripolitania to Ottoman rule. Hamet's brother Yusuf (r. 1795–1832) re-established Tripolitania's independence.