Swedish–Tripolitanian war (1796–1802)

The Swedish–Tripolitanian war was a naval conflict that took place from 1796 to 1802 between Sweden and Tripolitania over tribute payments.

Background
Tripolitan leader Yusuf Karamanli aimed to maintain power by reorganizing the military, expanding the fleet, and pushing into the southern Sahara. Trouble arose when Sweden and Denmark were slow to send gifts to him. In response, he seized ships from both countries to pressure them. Despite new demands reaching Sweden in 1794, Yusuf Karamanli insisted on renegotiating a peace treaty, ignoring objections from both the Ottoman Empire and Sweden. Unlike his father, who had honored peace agreements with Sweden, Yusuf Qaramanli repeatedly declared war on Sweden and captured several ships.

War
In 1797 Major David Gustaf Blessingh left Sweden with the frigate Thetis and the brig of war Husaren to resolve the conflict. In June 1798, the Tripolitans captured 20 ships and 160 Swedish sailors. Sweden started negotiating for peace soon after. Sweden and Denmark paid $100,000 for the release of their captives. The peace treaty of 1798 was unstable, prompting Yusuf Karamanli to declare war on Sweden once again in 1800. Sweden sent Lieutenant-Colonel Carl Gustaf Tornquist to negotiate a new peace treaty in early 1801 to free the hostages. The Swedes did not ratify it due to the harsh Tripolitan demands. In January 1801, the Swedish warship "Thundera" sailed into Tripoli Harbor with a white flag. During the conflict with Sweden, four merchant ships were seized and sold to Tunis, with their crews held hostage by Karamanli.

Blockade of Tripoli Harbor
In 1802 Swedish and American warships worked together to blockade Tripoli Harbor. They helped each other with convoys for their merchant ships, until a new peace treaty was signed. Sweden's Consul Burström reported that despite the treaty, the joint blockade didn't work because Tripoli's corsair galleys still accessed the port. Burström noted that the blockade's failure pleased Yusuf Karamanli.

Aftermath
In October 1802 Sweden withdrew from the First Barbary War and paid a significant tribute to Tripolitania, while the Regency of Tripoli continued the war against the Americans before eventually signing peace with the United States in 1805.