Karamanli dynasty
The Karamanli, Caramanli, Qaramanli, or al-Qaramanli dynasty was an early modern dynasty, independent or quasi-independent, which ruled from 1711 to 1835 in Ottoman Tripolitania. The territory comprised Tripoli and its surroundings in present-day Libya. At its peak, the Karamanli dynasty's influence reached Cyrenaica and Fezzan, covering most of Libya. The founder of the dynasty was Pasha Ahmed Karamanli, a descendant of the Karamanids. The most well-known Karamanli ruler was Yusuf ibn Ali Karamanli Pasha who reigned from 1795 to 1832, who fought a war with the United States in (1801–1805). Ali II Karamanli  marked the end of the dynasty. History. In the early 18th century, the Ottoman Empire was losing its grip on its North African holdings, including Tripolitania. A period of civil war ensued, with no ruler able to hold office for more than a year. Ahmed Karamanli, a Janissary and popular cavalry officer, murdered the Ottoman governor of Tripolitania and seized the throne in the 1711 Karamanli coup. After persuading the Ottomans to recognize him as governor, Ahmed established himself as pasha and made his post hereditary. Though Tripolitania continued to pay nominal tribute to the Ottoman padishah, it otherwise acted  as an independent kingdom. An intelligent and able man, Ahmed greatly expanded his city's economy, particularly through the employment of corsairs on crucial Mediterranean shipping routes; nations that wished to protect their ships from the corsairs were forced to pay tribute to the pasha. On land, Ahmed expanded Tripolitania 's control as far as Fezzan and Cyrenaica before his 1745 death. Tripolitanian civil war. Ahmad's successors proved to be less capable than himself, preventing the state from ever achieving the brief golden ages of its Barbary neighbors, such as Algiers or Tunis. However, the region's delicate balance  of power allowed the Karamanli to survive several dynastic crises without invasion. 'Ali ibn Mehmed neglected the affairs of state in the 1780s and delegated most of his power to his eldest son Hasan, whom he appointed as bey. The assassination of Hasan Bey in June 1790 by 'Ali's youngest son Yusuf Karamanli triggered a war of succession between Yusuf and Hamet Karamanli ('Ali's middle son, whom he appointed as bey after Hasan's death). In 1793, Ottoman officer Ali Burghul intervened, deposed Hamet and briefly restored Tripolitania to Ottoman rule. However, 'Ali, Hamet and Yusuf Karamanli returned  to Tripolitania in January 1794 with the aid of the bey of Tunis, expelled Burghul and reestablished Tripolitania's "de facto" independence under nominal Ottoman suzerainty. 'Ali formally abdicated in favour of Hamet, but Yusuf deposed Hamet within several months of the restoration, and ruled as bey of Tripoli during 1795–1832. Barbary Wars. In 1801, Yusuf demanded a tribute of $225,000 from United States President Thomas Jefferson. Jefferson, confident in the ability of the new United States Navy to protect American shipping, refused the Pasha's demands, leading the Pasha to unofficially declare war, in May 1801, by chopping  down the flagpole before the American consulate. Jefferson responded by ordering the US Navy into the Mediterranean, successfully blockading Tripolitania's harbors in 1803. After some initial military successes, most notably the capture of the USS Philadelphia, the pasha soon found himself threatened with invasion by American ground forces following the Battle of Derna and the reinstatement of his deposed brother, Hamet Karamanli, recruited by the American army officer William Eaton. On June 10, 1805, he signed the Treaty of Peace and Amity ending the war. Decline. By 1819, the various treaties of the Napoleonic Wars had forced the Barbary  states to give up piracy almost entirely, and Tripolitania's economy began to crumble. Yusuf attempted to compensate for lost revenue by encouraging the trans-Saharan slave trade, but with abolitionist sentiment on the rise in Europe and to a lesser degree the United States, this failed to salvage Tripolitania's economy. As Yusuf weakened, factions sprung up around his three sons; though Yusuf abdicated in 1832 in favor of his son Ali II, civil war soon resulted. Ottoman Sultan Mahmud II sent in troops ostensibly to restore order, but instead deposed and exiled Ali II, marking the end of  both the Karamanli dynasty and an independent Tripolitania. A descendant family with the same name still exists in modern Tripoli-Libya.