The 1711 Karamanli coup, a popular revolt at the end of a period of civil war in Tripolitania led by the Turkish officer Ahmed Karamanli against the ruling Tripolitanian bey, in which Karamanli seized control of Tripoli and installed himself as the head of the Karamanli dynasty, which ruled over Tripolitania, Cyrenaica, and Fezzan for 124 years as a semi-autonomous Ottoman province, until 1835.[1]