In 1785, Congress agreed to make tribute treaty agreements with the Barbary States. The first treaty was with Morocco in 1787. Apart from some minor disagreements, Morocco never attacked U.S ships again.
Courtesy of Historic UK
The second treaty was with the most powerful Barbary State, Algiers. In 1785, Algiers captured two American merchant ships, holding 21 men for ransom. Negotiations for their release continued for eleven years.
The commissioners most involved in negotiating these treaties were Adams and Jefferson. Adams argued that the best way to deal with the pirates was to continue paying tributes. Jefferson disagreed. He did not see an end to the tribute demands. Jefferson wanted to fix the problem by going to war.
In 1790, the Algiers pirates captured 11 American ships and crew, beginning debates in Congress about the need for a navy. It took five years for Congress to authorize the building of six warships.
The United States signed a treaty with Algiers in 1796. The U.S would pay $642,500 and make an annual tribute of naval supplies and presents for Algiers’ ruler. Algiers would then release their captives and stop attacking American shipping.