For years the rulers of the Barbary States (Algeria, Tunis, Tripoli, and Morocco) demanded tribute from all nations trading in their waters. Barbary pirates seized passing ships, ransoming the passengers and crew. After 1775, British warships no longer protected American interests. The United States had little choice but to pay tribute until our Navy was built. The expanding American trade made the United States a most profitable enemy. The atrocious conduct of the Barbary pirates brought the nations closer to war. These actions forced the United States Congress to act with the creation of the six frigates. Approved by President George Washington in March 1794, three of them were constructed in time for the Quasi-War with France.
In 1796, a treaty with Morocco was ratified where the United States forgave money and a frigate was to be built for the Dey, which was the Crescent. The frigate was delivered in 1798 and renamed El-Merkane. Despite this treaty, payments were still demanded. The frigate George Washington, the first United States ship in the Mediterranean and commanded by William Bainbridge, was forced under pressure to carry presents under Algerian flag from the Dey to the Sultan at Constantinople (now Istanbul). In April 1800, the Pasha of Tripoli demanded a frigate, or a brig-of-war, like the United States had given to Algiers. Negotiations broke down. In May 1801, Tripoli declared war against the United States.
President Thomas Jefferson and Secretary of the Navy Robert Smith dispatched Commodore Richard Dale with a squadron for a blockade of the Tripoli harbor as a show of force. Progress was hard with a lack of supplies and harsh winters. In 1803, the squadron was commanded by Commodore Edward Preble, aboard his flagship Constitution. Notable events were the running aground of the frigate of Philadelphia near Tripoli, the subsequent burning of the frigate led by Lieutenant Stephen Decatur, the Bombardment of Tripoli, the explosion of the ketch Intrepid to destroy the enemy fleet at Tripoli, and the first United States flag raising on foreign soil at Derna, Tripoli.
On June 10, 1805, a peace treaty was signed. In this treaty, there wouldn't be any payment for the peace or provide for a future tribute, though there would be a ransom paid for the release of the prisoners from the Philadelphia. Subsequently, conflict with payments were not fully settled and difficulties continued in the region, resulting in the Second Barbary War in 1815. One of the military lessons from the war was close coordination of a number of naval vessels for long periods of time during combat operations.