Yusuf (ibn Ali) Karamanli, Caramanli or Qaramanli or al-Qaramanli (most commonly Yusuf Karamanli), (1766 – 1838) was the longest-reigning Pasha of the Karamanli dynasty of Tripolitania (in present-day Libya). He is noted for his role in the Barbary Wars against the United States. Assumption of the throne Born in Tripoli in 1766, Karamanli, a member of the Karamanli dynasty (named after the Karamanids in Turkey), was originally of Turkish origin. His brother, Hamet Karamanli, was deposed from leadership in 1793 by Ottoman Empire officer Ali Pasha, who proceeded to exile the Karamanli family and claim Ottoman rule over Tripoli. In 1795, Hamet and Yusuf returned to Tripoli, and with the aid of Hammuda Pasha of the neighboring Barbary state of Tunis, recaptured it from Ali Pasha. Yusuf then had his brother exiled to Alexandria, Egypt and claimed the throne for himself. Barbary Wars In 1796, Karamanli drafted and signed the Treaty of Tripoli, which permitted the passage of American commercial ships through Tripolitanian waters. In 1801, Karamanli allegedly violated the treaty by demanding a tribute of $225,000 from third American President Thomas Jefferson. Jefferson, confident in the ability of the fledgling United States Navy (newly reinforced with the building of six heavy frigates beginning in 1797) to protect American shipping, refused the Pasha's demands. This lead the Pasha to unofficially declare war in May 1801 by chopping down the flagpole with the American flag before the U.S. consulate. The U.S. Navy attempted to blockade Tripoli's harbors with a squadron sent by President Jefferson in 1803. After some initial military successes, most notably the capture of the grounded American frigate USS Philadelphia in October 1803, the Pasha soon found himself threatened after a raid led by US Navy lieutenant Stephen Decatur to burn and scuttle the Philadelphia in Tripoli's harbor. By 1805, following a defeat at the Battle of Derna as well as the allied recruitment of his deposed brother Hamet Karamanli by American army officer and diplomatic consul William Eaton, Karamanli was forced to capitulate. He signed a treaty with American emissary Tobias Lear of the U.S. Department of State that officially ended the war on 10 June 1805. Al-Jawazi massacre On 5 September 1817, Yusuf Karamanli invited the leaders of the al-Jawazi tribe of Libya to his castle in Benghazi, following a dispute regarding tribute and an al-Jawazi uprising against his rule. Consequently, the Pasha ordered the execution of