So great was the problem posed by the state-sponsored piracy that the Barbary nations are mentioned explicitly in the Treaty of Amity and Commerce, a 1778 pact between France and the United States [source: Yale]. The treaty calls on France to use its diplomatic powers to protect captured sailors and persuade the leaders of the Barbary nations to refrain from capturing American ships.
This treaty was hammered out largely by Benjamin Franklin. He served as one of the United States' first diplomats and was succeeded as America's ambassador to France by Thomas Jefferson in 1785 [source: National Archives]. The U.S. was deeply allied with France because its relations with another superpower -- England -- were shaky at best. It was from Paris that Jefferson began a campaign against the Barbary States.
Jefferson tried to assemble a confederation of nations to take action against the Barbaries. His plan failed, however, because it lacked consent from France and England [source: Gawalt]. He would have to wait until he became president to enjoy enough autonomy to take on the Barbary States. In the meantime, the U.S. and Europe continued to pay tribute and lose citizens and goods to the pirates. In one case, an American vessel bringing tribute to Algiers was forced to sail on to Constantinople to deliver Algiers' tribute to the king there -- with the humiliating command to fly the flag of Algiers en route [source: Fremont-Barnes].
Just before Jefferson's inauguration in 1801, the pasha (Turkish ruler) of Tripoli released the crew members of two recently captured American ships on the condition that the U.S. increase its tribute. If America refused, the Barbary States would declare war on the United States. Jefferson ordered a naval expedition to the Mediterranean, resulting in the First Barbary War (1801-1805). In the war, Tunis and Algiers broke their alliance with Tripoli. For four years, the U.S. fought with Tripoli and Morocco. The battles were mostly naval, including Lt. Stephen Decatur's daring raid on the Tripoli harbor to demolish a captured American ship, removing it from enemy hands.
But it was on land -- through military action and diplomacy -- that the U.S. won the war with the Barbary States. Using tactics similar to those of the Green Berets today, a contingent of American Marines landed in Tripoli (which gave rise to the first line in the Marines' anthem) and identified groups in opposition to the pasha. These opposition groups were amassed into an insurgency that threatened the pasha's throne. As a result, Tripoli agreed to a treaty ending the war in 1805 [source: Gawalt].
The Second Barbary War (1815), under President James Monroe's term, was more ham-fisted than the first. In this war, U.S. vessels bombarded Tunis and Algiers, captured prisoners and demanded treaties that freed the U.S. from both Barbary threat and extorted tribute [source: The New American]. The Second Barbary War lasted less than a year, and following its show of naval strength, the U.S. discontinued paying tribute to the Barbary States. This caused a ripple effect among the European nations. Within the next decades, the coast of North Africa and the Barbary rulers fell to European imperialism [source: Encyclopedia Britannica].
For more information on pirates and other related topics, visit the next page.