Answer:
In 1805, disputes with Barbary pirates, the capture of US sailors, and the payment of high tribute in exchange for ransom forced Jefferson to war with Tripoli.
Step-by-step explanation:
The Tripolitanian War (or First Barbary War) was a naval war between the United States and the states of North Africa known as the Berber States (basically those between western Egypt and the Atlantic). These were the independent Sultanate of Morocco, and the three Regencies of Algeria, Tunisia and Tripoli, which were quasi-independent entities nominally belonging to the Ottoman Empire.
The main motivation of the war by the United States was to put an end to Berber piracy without having to pay the taxes that the Berber States demanded to guarantee immunity against pirate attacks.
This first Berber war would end with the taking of Derna by US forces, which would trigger the start of negotiations for the release of hostages and the end of the war.