Here is a PBS report on President Thomas Jefferson’s war against Islamic fundamentalism. This PBS film appeared on The McNeil/Lehrer News Hour in 1987.
According to the U.S. Department of State, Office of the Historian:
The adoption of the Constitution in 1789 gave the U.S. Government the power to levy taxes and to raise and maintain armed forces, powers which had been lacking under the Articles of Confederation. In 1794, in response to Algerian seizures of American ships, Congress authorized construction of the first 6 ships of the U.S. Navy. In 1801, the Pasha of Tripoli, Yusuf Qaramanli, citing late payments of tribute, demanded additional tribute and declared war on the United States. The United States successfully defeated Qaramanli’s forces with a combined naval and land assault by the United States Marine Corps. The U.S. treaty with Tripoli concluded in 1805 included a ransom for American prisoners in Tripoli, but no provisions for tribute.
In 1812, the new Dey of Algiers, Hajji Ali, rejected the American tribute negotiated in the 1795 treaty as insufficient and declared war on the United States. Algerian corsairs captured an American ship several weeks later. In accordance with an agreement between the Dey and British diplomats, the Algerian declaration was timed to coincide with the start of the War of 1812 between Britain and the United States. The war with Britain prevented the U.S. Government from either confronting Algerian forces or ransoming U.S. captives in Algiers. Once the Treaty of Ghent ended war with Britain, President James Madison was able to request that Congress declare an authorization of force on Algiers, which it did on March 3, 1815. The U.S. Navy, greatly increased in size after the War of 1812, was able send an entire squadron, led by Commodore Stephen Decatur, to the Mediterranean.