The following is an excerpt from Richard Hobbs' new book, Death By a Thousand Cuts:
Our representatives in Europe at the time were John Adams, Benjamin Franklin, and Thomas Jefferson. The Barbary Pirates became a serious concern and Adams and Jefferson met with the ambassador from the Bey of Algiers. Ambassador Abdul al-Rahman told them that Allah directed in the Qur'an that all unbelievers were sinners and, if they did not convert, they should be made slaves. Ever the scholar, Jefferson obtained a Qur'an to better understand the foe.
"The Muslims never called their naval raiders 'Barbary Pirates.' They called them 'ghazis,' sacred raiders...actually jihad by the army of Muhammad." - Bill Warner
The navy we had established during the War for Independence had been disbanded so we had no force to take on the pirates. We were paying large sums in tribute, eventually exceeding 10 percent of the country's budget and increasing. At that time we were developing our constitution since the Articles of Confederation had proven inadequate. One of the arguments for a strong federal government was that we needed a federal navy. The US Navy was formed in 1794.
When Thomas Jefferson became president, one of his early acts was to send the navy to deal with the Barbary Pirates.