Barbary Wars

1801–1816

The Barbary Wars were conflicts between the United States and the North African Barbary States, which were known for their piracy and extortion. After gaining independence and losing British naval protection, the U.S. faced demands for tribute and attacks on its ships. Diplomatic and military efforts, including treaties and naval battles, helped end the threat of the Barbary Pirates and increased U.S. maritime strength.

Barbary Wars, 1801-1816, American History Central

Stephen Decatur’s Conflict with the Algerine at Tripoli, Unknown Artist (after Alonzo Chappell). Image Source: Naval History and Heritage Command.

Essential Facts

  • First Barbary War (1801–1805) — The first overseas war conducted by the United States. The nations involved were Algiers, Tunis, and Tripoli, which were on the Barbary Coast of Morocco. The war ended in victory for the United States, with peace treaties between the three Barbary States and Morocco.
  • Second Barbary War (1815–1816) — Also known as the Algerine War, it was fought from 1815 to 1816 between the United States and the Barbary States of North Africa, specifically Algiers. Like the First Barbary War, the conflict was triggered by the Barbary Pirates’ attacks on American merchant ships and their demands for tribute payments. After the War of 1812, the U.S. sought to end these payments and protect its trade interests. Under the command of Commodores Stephen Decatur and William Bainbridge, the U.S. Navy launched successful attacks on Algiers, forcing the Dey of Algiers to sign a treaty that ended tribute payments and secured the release of American prisoners. The war marked the end of the Barbary Pirates’ control over U.S. and European shipping in the Mediterranean.

Key Details

  • The Barbary States created problems for the U.S. starting in the 1780s. The Barbary States included Morocco, Algiers, Tunis, and Tripoli. These states engaged in state-supported piracy, demanding tribute (money) from weaker nations.
  • In 1793, Algiers captured 11 U.S. merchant ships and enslaved over 100 American sailors.
  • The U.S. started building a navy to confront the Barbary Pirates, but a 1795 settlement cost nearly $1 million.
  • A war with Tripoli broke out in 1801 and lasted until 1805. The U.S. paid $60,000 for the release of naval prisoners.
  • Tripoli agreed to end tribute payments, leading to similar terms with other Barbary States until the War of 1812, when renewed seizures by Algiers prompted a response.
  • In 1815, with an expanded U.S. fleet, Stephen Decatur forced the Barbary States to accept treaties without paying tribute.
  • Through a combination of fortunate circumstances and military strength, the U.S. emerged from these wars in a stronger position on the world stage.

Significance

The Barbary Wars are important to American History because they were some of the nation’s first major international military engagements and established its naval power. In these conflicts, the U.S. protected its maritime interests and showed its ability to conduct overseas military operations. The successful treaties and military actions that resulted from the Barbary Wars helped bring an end to the era of state-supported piracy in the Mediterranean, creating safer international trade routes.

History

The Barbary Wars were two conflicts between the United States and the Barbary States of North Africa in the early 19th Century. These states, which included Morocco, Algiers, Tunis, and Tripoli, were known for their practice of state-supported piracy. At the time of the Barbary Wars, Morocco was an independent kingdom, while Algiers, Tunis, and Tripoli were loosely affiliated with the Ottoman Empire.

The Barbary States demanded payments, called “tribute,” from nations, like the U.S., with weak naval defenses. If the U.S. refused or failed to pay, then ships from the Barbary States would attack U.S. merchant ships on the open seas, often capturing ships and taking sailors as prisoners.

The U.S. engaged in two wars with the Barbary States. These wars were part of America’s efforts to protect its maritime interests without giving in to the demands for tribute. However, there were times when the U.S. did choose to pay tribute to secure the release of Americans and to ensure the safety of its ships.

  1. The First Barbary War took place from 1801 to 1805, involving a series of naval battles and negotiations with Tripoli. 
  2. The Second Barbary War took place from 1815 to 1816 and was primarily directed against Algiers. 

Privateers and Pirates

State-supported piracy and the ransoming of captives were standard practices during the early 19th Century. Many European countries sanctioned Privateers to attack and harass enemy vessels.

  • Privateers — Privately owned ships authorized to engage in warfare on behalf of a country.

Great Britain and France, the two dominant European powers, utilized the situation with the Barbary States to their advantage, as they could afford to pay tribute. This ensured that their ships could safely access ports in the Mediterranean Sea. On the other hand, the leaders of the Barbary States were also aware of British and French naval power, and typically avoided confrontations with them.

Protection on the High Seas for American Merchants 

During the Colonial Era, American merchant ships were protected on the high seas by the British Royal Navy. However, after Congress declared independence on July 4, 1776, British officials notified the Barbary States that American ships were no longer protected.

Trade with Morocco

In 1784, Moroccan Sultan Sidi Muhammad of Morocco had a U.S. merchant ship seized after the U.S. ignored his tribute request. However, Sultan Muhammad preferred peaceful trade and pursued a diplomatic solution. As a result, the U.S. and Morocco signed a treaty in 1786, establishing friendly trade relations.

Algiers Declares War on the U.S.

In 1785, Dey Muhammad of Algiers declared war on the United States and seized several American ships. The Articles of Confederation still governed the U.S., and the weak Confederation Congress lacked the resources and authority to pay tribute to the Barbary States.

Portugal Lends Support

Thomas Jefferson, the U.S. Minister to France, sought to deal with Algiers by forming a coalition between nations with a weak naval presence. Although this plan failed, he did gain support from the Kingdom of Portugal and temporarily reduced attacks on American ships.

  • Portugal was also at war with Algiers.
  • Portuguese forces blocked Algerian ships from passing through the Straits of Gibraltar. 
  • This prevented Algerian pirates from entering the Atlantic Ocean, protecting U.S. merchant ships in the region.

Authority of the Federal Government

The U.S. adopted the Constitution in 1789, establishing a new, stronger Federal Government. Unlike the Confederation Congress, the new Congress had the authority to levy taxes and raise military forces for national defense, as needed. 

U.S. Agrees to Pay Tribute

In 1793, Portugal and Algiers agreed to a truce, and the blockade was lifted. Once again, American ships were vulnerable to attacks from Barbary Pirates.

  • Congress opened negotiations with Algiers, Tunis, and Tripoli.
  • Joel Barlow, Joseph Donaldson, and Richard O’Brien were sent to negotiate on behalf of the U.S.
  • They successfully created treaties with each nation. However, the treaties included paying tribute to ensure the safety of American ships and sailors.
  • 83 Americans who were being held as prisoners were freed.

First Ships in the U.S. Navy

In 1794, Congress authorized the construction of the first six ships of the U.S. Navy to help protect American merchant ships on the high seas.

  • John Barry, a veteran of the American Revolutionary War and the Continental Navy, volunteered to lead the new U.S. Navy.
  • President George Washington appointed him as the first Captain of the Navy.
  • Barry oversaw the construction of the new ships that would be used against the Barbary Pirates.
John Barry, Commodore, US Navy, NHHC
John Barry. Image Source: Naval Heritage and History Command.

First Barbary War

In 1801, Yusuf Qaramanli, the Pasha of Tripoli, demanded additional tribute from the United States, citing delayed payments as justification. When President Thomas Jefferson refused, Tripoli declared war on the U.S.. In response, the U.S. launched a successful combined naval and land assault, involving the U.S. Marine Corps.

  • On August 1, 1801, the USS Enterprise defeated the Tripoli at sea. 
  • In 1802, Jefferson increased the Navy’s presence in the area by deploying additional ships under the command of Commodore Edward Preble.
  • The U.S. Navy attacked Tripoli in July 1804.
  • In May and April 1805, U.S. forces won the Battle of Derna. For the first time in history, the American Flag was raised on foreign soil.

This war ended in 1805 with a treaty between the United States and Tripoli. The treaty included a ransom payment for American prisoners but did not include any provisions for future tribute payments.

Battle of Derna, 1805, First Barbary War, Waterhouse, USMC
The Assault on Derna by Colonel Charles H. Waterhouse, USMCR (Ret). Image Source: USMC Facebook.

The Second Barbary War

In 1812, the Dey of Algiers, Hajji Ali, decided that the tribute agreed upon in the 1795 treaty was not high enough, and Algiers declared war on the U.S. Soon after, Algerian ships seized an American ship. 

  • British officials influenced this declaration of war so that it coincided with the start of the War of 1812.
  • The war with Britain hindered the U.S. Government’s ability to address the Algerian threat or recover Americans being held in Algiers.
  • The War of 1812 ended in 1814, when the Treaty of Ghent was signed.

On March 3, 1815, Congress declared war on Algiers at the request of President James Madison. By this time, the U.S. Navy was significantly larger and more experienced. A squadron of ships, led by Commodore Stephen Decatur, was sent to the Mediterranean to confront the Algerians. During the voyage, the Americans defeated two Algerian warships and captured their crews as prisoners.

Upon Decatur’s arrival in Algiers, Dey Omar was in power. Although he sought to restore order after years of political turmoil, he recognized the lack of British support and knew he was in a weak position. 

  • Dey Omar accepted Decatur’s terms, which included the exchange of prisoners and the end of tribute and ransom practices. 
  • Decatur negotiated similar treaties with Tunis and Tripoli. In Tripoli, he also secured the release of all European captives from Pasha Qaramanli.

The U.S. Senate ratified Decatur’s treaty with Algiers on December 5, 1815. However, Dey Omar repudiated the treaty.

  • Another squadron of U.S. ships was sent to Algiers.
  • Commissioner William Shaler enforced the terms of a new treaty, which were similar to the original. 
  • Shaler concluded negotiations on December 23, 1815.
  • The Senate did not ratify this new treaty until February 11, 1822, due to an oversight.

Aftermath

Although the Barbary States stopped harassing U.S. ships, they continued their raids in the Mediterranean. 

  • Despite several bombardments by British forces, the Barbary States did not entirely abandon their practices of piracy and extortion. 
  • It was not until the French conquest of Algeria in 1830 that the threat of the Barbary Pirates was effectively ended.

AP US History Alignment

The Barbary Wars are part of the following units, topics, and chapters in the AP US History curriculum:

Unit 4: 1800–1848

  • 4.4 — America on the World Stage

Notes

Citation Information

The following information is provided for citations, including APA Style, Chicago Style, and MLA Style.

  • Article Title Barbary Wars
  • Date 1801–1816
  • Author
  • Keywords Barbary Wars, First Barbary War, Second Barbary War
  • Website Name American History Central: The Encyclopedia of American History
  • Publisher American History Central
  • Producer R.Squared Communications, LLC
  • Date Published
  • Last Update June 27, 2025
  • Access Date October 10, 2026

Encyclopedia Sections