The Barbary Wars were a series of conflicts culminating in two main wars fought between the United States, Sweden, and the Barbary states of North Africa in the late 18th and early 19th centuries. The Swedes had been at war with the Tripolitans since 1800; they were joined by the Americans. The Barbary pirates demanded tribute from American merchant vessels in the Mediterranean Sea. If they failed to pay, the pirates would attack the ship, take their goods, and often enslave crew members or hold them for ransom. When Thomas Jefferson became President of the United States in March 1801, he refused to pay tribute and sent a United States Naval fleet to the Mediterranean. The fleet bombarded various fortified pirate cities in present-day Libya, Tunisia, and Algeria, ultimately extracting concessions of fair passage from their rulers. James Madison, Jefferson's successor, directed military forces for the second war in 1815, shortly after the conclusion of the War of 1812 with the Treaty of Ghent.
Barbary corsairs
The Barbary corsairs, sometimes called Ottoman corsairs or Berber pirates, were pirates and privateers who operated from North Africa, based primarily in the ports of Tunis, Tripoli, and Algiers. This area was known in Europe as the Barbary Coast, a term derived from the name of its Berber inhabitants. Their predation extended throughout the Mediterranean, south along West Africa's Atlantic seaboard and even to the eastern coast of South America with Brazil, and into the North Atlantic Ocean as far north as Iceland, but they primarily operated in the western Mediterranean. In addition to seizing ships, they engaged in razzias, raids on European coastal towns and villages, mainly in Italy, France, Spain, and Portugal, but also in England, Scotland, the Netherlands, Ireland, and as far away as Iceland. The main purpose of their attacks was to capture Europeans for the Arab slave market in North Africa. The Barbary states were the de jure possessions of the Ottoman Empire, but de facto independent.
Attacks
Since the 1600s, the Barbary pirates had attacked British shipping along the North Coast of Africa, holding captives for ransom or enslaving them. Ransoms were generally raised by families and local church groups. The British became familiar with captivity narratives written by Barbary pirates' prisoners and slaves. During the American Revolutionary War, the pirates attacked American ships. On December 20, 1777, Morocco's sultan Mohammed III declared that merchant ships of the new American nation would be under the protection of the sultanate and could thus enjoy safe passage into the Mediterranean and along the coast. The Moroccan-American Treaty of Friendship stands as America's oldest unbroken friendship treaty with a foreign power. In 1787, Morocco became one of the first nations to recognize the United States of America. Starting in the 1780s, realizing that American vessels were no longer under the protection of the British navy, the Barbary pirates had started seizing American ships in the Mediterranean. As the U.S. had disbanded its Continental Navy and had no seagoing military force, its government agreed in 1786 to pay tribute to stop the attacks. On March 20, 1794, at the urging of President George Washington, the United States Congress voted to authorize the building of six heavy frigates and establish the United States Navy, in order to stop these attacks and demands for more and more money. The United States had signed treaties with all of the Barbary states after its independence was recognized between 1786-1794 to pay tribute in exchange for leaving American merchantmen alone, and by 1797, the United States had paid out $1.25 million or a fifth of the government's annual budget then in tribute. These demands for tribute had imposed a heavy financial drain and by 1799 the U.S. was in arrears of $140,000 to Algiers and some $150,000 to Tripoli. Many Americans resented these payments, arguing that the money would be better spent on a navy that would protect American ships from the attacks of the Barbary pirates, and in the 1800 Presidential Election, Thomas Jefferson won against incumbent second President John Adams, in part by noting that the United States was "subjected to the spoliations of foreign cruisers" and was humiliated by paying "an enormous tribute to the petty tyrant of Algiers".
The First Barbary War, also known as the Tripolitian War or the Barbary Coast War, was the first of two wars fought between the alliance of the United States and several European countries against the Northwest African Berber Muslim states known collectively as the Barbary states. These were Tripoli and Algiers, which were quasi-independent entities nominally belonging to the Ottoman Empire, and the independent Sultanate of Morocco. This war began during Thomas Jefferson's term when he refused to pay tribute, an amount that was greatly increased when he became president. A U.S. naval fleet was sent on May 13, 1801, at the beginning of the war under the command of Commodore Richard Dale. Other notable officers in the fleet included Stephen Decatur, assigned to the frigate and William Bainbridge in command of Essex which was attached to Commodore Richard Dale's squadron which also included, and. During this war, the ship Philadelphia was blockading Tripoli's harbor when she ran aground on an uncharted reef. Under fire from shore batteries and Tripolitan gunboats, the Captain, William Bainbridge, tried to refloat her by casting off all of her guns and other objects that weighed it down. The ship was eventually captured and the crew taken prisoners and put into slavery. To prevent this powerful war ship from being used by the Barbary pirates the ship was later destroyed by a raiding party led by Stephen Decatur.
The Second Barbary War, also known as the Algerine or Algerian War, was the second of two wars fought between the United States and the Ottoman Empire's North African regencies of Tripoli, Tunis and Algeria, known collectively as the Barbary states. The war between the Barbary States and the U.S. ended in 1815; the international dispute would effectively be ended the following year by the United Kingdom and the Netherlands. The war brought an end to the American practice of paying tribute to the pirate states and helped mark the beginning of the end of piracy in that region, which had been rampant in the days of Ottoman domination. Within decades, European powers built ever more sophisticated and expensive ships which the Barbary pirates could not match in numbers or technology.
Effect in United States
When the United States military efforts of the early 19th century were successful against the pirates, partisans of the Democratic-Republicans contrasted their presidents' refusals to buy off the pirates by paying tribute with the failure of the preceding Federalist administration to suppress the piracy. The Federalist Party had adopted the slogan, "Millions for defense, but not one cent for tribute," but had failed to end the attacks on merchant ships. From 1796–1797 French raiders seized some 316 American merchant ships flying American colors. To counter this ongoing advent three frigates,, and, were soon built to answer the call for security.
Later
In the 21st century, the United States again conducted military operation in the North African area, specifically participating in the intervention against the government of Libya, and this operation has sometimes been termed in the media as the continuation of the previous Barbary Wars and given the name "Third Barbary War".