Closed Now
Closed Now
Closed Now
Closed Now

First Barbary War (1803 – 1805)

Anchor Icon

The First Barbary War (1801-1805) reflected the United States’s first efforts at diplomatic negotiations as a new sovereign nation. Though it was not America’s first naval conflict, this first war with the Barbary States of Morocco, Tunis, Tripoli, and Algiers established much of the early U.S. Navy’s reputation and set the stage for American involvement in the Mediterranean for decades to come. A Second Barbary War in 1815, also known as the U.S.–Algerian War, resulted from a brief repudiation by Algiers of earlier agreements, but was ended in two months by the arrival of an overwhelming American naval force.

A New Trader on the World Stage

The First Barbary War was rooted in the circumstances of the American Revolutionary War. As the American Revolution drew to a close, U.S. merchants found themselves shut out of previous trade and threatened by foreign adversaries around the globe. The new nation had largely expected to seamlessly participate in free trade with other sovereign nations, but that was not the case. Having divested themselves from Great Britain, American merchants not only lost the protection of the powerful British Royal Navy, but remained cut off from trade with British colonies. Both Britain and other European nations saw the United States as a competitor on the world’s trade stage and were loathe to accept the new nation as an equal.

As a result, American merchants lost both protection and participation in many markets. In the Mediterranean, that meant being raided by the Barbary States of North Africa. The state-sanctioned Barbary corsairs had been raiding European commerce for centuries and sustained their treasuries with tribute paid in exchange for unfettered passage. Without the protection of the British Royal Navy, U.S. merchants faced seizure along the length of the Mediterranean. The independent state of Morocco, situated at the Strait of Gibraltar, controlled ports that stretched down the Atlantic coast of Africa. To the east in the Mediterranean were Algiers, Tunis, and Tripoli, all nominally part of the Ottoman Empire. They largely acted on their own, however, and were influenced by the constantly shifting state of relations among the European nations. To secure trade in the Mediterranean, the United States would have to deal with each North African state separately.

Peace with Morocco

The first negotiation began with Morocco, which was eager to establish trade with the Americans. Morocco was among the first foreign nations to recognize the American colonies’ independence from Great Britain, and sent a proposal for a free trade agreement in 1778. The ongoing revolution and subsequent limitations of the initial U.S. government kept the Americans from ever formally replying. In October 1784, Moroccan corsairs, acting on behalf of the Sultan of Morocco, Sidi Mohammed ben Abdallah, seized the U.S. merchant ship Betsey as it departed the Mediterranean on a return trip to the United States. Though Moroccan corsairs had a long and notorious reputation for seizing shipping in exchange for tribute and crew ransoms, this capture was specifically intended to bring the Americans to a peace and trade treaty. Sidi Mohammed ben Abdallah had decided that the benefits of trade with the Americans amid the volatility of Europe would outweigh that of tribute and possible reprisals.

The United States agreed, and the Moroccan-American Treaty of Peace and Friendship, also known as the Treaty of Marrakesh, was signed in 1786. Flush with success in resolving the first of these obstacles to free trade, Americans authorities hoped to create similar treaties with the other Barbary States. Those hopes were quickly dashed.

The Algerian Conundrum

Algiers presented a much thornier problem. In 1785, Algiers had captured two American ships. The ships’ crews remained imprisoned in horrific conditions for the next decade while awaiting a ransom or other settlement agreement. American negotiators had to settle on a price for release, but doing so would set a precedent for Algerian expectations in future captures or the cost of future tribute.

The urgency of the situation was blunted by the support of Portugal, which also had no agreement with Algiers. Heavy importers of U.S. grain, Portugal promised in 1787 to use its own navy to protect U.S. merchant ships in the approaches to the Mediterranean, and Algiers avoided future captures in the Atlantic as a result. Any peace between Algiers and Portugal would end that protection.

In the fall of 1793, peace between Algiers and Portugal came in the form of a year-long truce brokered by Britain. The British were eager for Portuguese naval support in the fight with revolutionary France, but may have participated in the deal to thwart American trade. Algerian corsairs immediately sailed through Gibraltar to begin raiding U.S. ships in the Atlantic. By the beginning of 1794, they had captured 11 more American merchant ships, raising the number of captive crew to about 120.

The renewed Algerian aggression forced the United States to reassess its tactics.

Tribute, Force, or Withdrawal

One of the most fundamental foreign policy decisions of the early United States was its response to the Barbary States, particularly Algiers. The need to enter into diplomatic agreements with foreign nations was one reason the United States replaced the Articles of Confederation with the Constitution of the United States in the 1780s. The circumstances in the Mediterranean were central to the debates that shaped the new Constitution. As a result, the governing document vested the federal government with control of commerce and established federal authority to make treaties and payments. States could no longer set their own tariffs and restrictions on foreign trade. In addition, the Constitution gave the federal government the authority to establish a naval force. In negotiating with the Barbary States, the United States government grappled for the first time with the use of this power. Would the new nation pay tribute for passage, continue to pay ransoms for captured ships and sailors, withdraw from the Mediterranean markets, or mount an opposition to the corsairs?

Paying tribute required separate negotiations with each Barbary State, and the conditions of tribute were not guaranteed in perpetuity. Each state could demand more tribute or resume seizing ships and crews for individual ransoms. Continuing to pay ransoms was untenable because it led to increased insurance rates on U.S. merchant ships entering the Mediterranean. Americans held for ransom also faced abysmal conditions while in captivity. Merely surrendering the lucrative Mediterranean trade was not a popular solution. In 1791, Secretary of State Thomas Jefferson reported to Congress on the state of trade in the Mediterranean. Although the Custom House records were destroyed during the American Revolution, making the complete history of trade difficult to assess, Jefferson wrote, “it may be concluded that about one Sixth of the Wheat and Flour exported from the United States. and about one Fourth in Value of their dried and pickled Fish, and some Rice, found their best Markets in the Mediterranean Ports: that these Articles constituted the principal Part of what we sent into that Sea: that that Commerce loaded outwards from Eighty to one hundred Ships, annually, of Twenty thousand Tons, navigated by about Twelve hundred Seamen. It was abandoned early in the War: and, after the Peace which ensued, it was obvious to our Merchants that their Adventures into that Sea would be exposed to the Depredations of the piratical States on the Coast of Barbary.”1 The United States was left in a debate over whether to negotiate tribute or fend off corsairs by force.

Approving a New Navy

For many Americans, the prospect of establishing and funding a navy to protect merchants and defeat the Barbary corsairs seemed far more costly and less expedient than merely paying tribute. Others argued that the open-ended nature of tribute would not only be more expensive in the long run, but would continue to force the United States into a subordinate role.

The argument was complicated by some Americans’ fears of investing in a standing military that could become a tyrannical force in the new republic. The nation was fiercely divided over the issue. Eventually, in the wake of the seizures that followed Algiers’ peace with Portugal, Congress voted in March 1794, by a very narrow margin, to appropriate funding for the construction of six new naval warships. The vote included a provision stipulating that construction of the warships would be halted if peace was achieved with Algiers.

A Temporary Peace

The threat of potential American force did not diminish Algerian demands. Following the news of the United States’ Act to Provide a Naval Armament, Hassan Bashaw, Dey of Algiers, raised his demands for a tribute that included personal payments to himself, replenishment of the Algerian treasury, ransom for captive sailors, and even the construction of an Algerian warship.

A Treaty of Peace and Amity was reached in the fall of 1795 that reduced the tribute payment to about a third of the original demand and ensured safe passage for American merchant ships. Congress was bitterly divided over support for the treaty, but it was ultimately seen as a necessary resolution to the Algerian issue. With the treaty in place, the United States could turn its attention to the two remaining Barbary States, Tunis and Tripoli.

Treaties with both Tunis and Tripoli were signed by the fall of 1797, clearing the way for safe American transit of the Mediterranean. But this safe transit came at a substantial ongoing cost in the form of tribute to Algiers, Tunis, and Tripoli. The treaties were only as good as the last payment, and the leaders of all three Barbary States were willing to threaten American shipping in order to see payments not only continue but increase over time.

Building a United States Navy

With an Algerian peace treaty in hand, the United States should have halted construction of all six naval warships. Instead, an agreement was pushed through Congress to complete construction of three frigates: USS Constitution in Boston, USS United States in Philadelphia, and USS Constellation in Baltimore.

Construction of the other three frigates was paused briefly, but it did not last long. While peace was being pursued in the Mediterranean, the United States began facing threats from the French in the Caribbean. [See The Quasi-War with France (1798-1801)]. The French seizure of U.S. merchant ships in the Caribbean pushed Congress to continue construction of all six frigates, authorize additional construction, and deploy naval warships to the Caribbean.

The Declaration of War

Tenuous peace in the Mediterranean continued until 1800, but only at the ongoing and rising costs of regular tributes. Algiers, Tunis, and Tripoli all demanded more and more money from the Americans, who were falling behind in making payments. Political opposition to the arrangements was growing in the United States, but two specific incidents precipitated the war.

In September 1800, Captain William Bainbridge arrived in the Mediterranean on the frigate USS George Washington to deliver tribute and other items to the Dey of Algiers. However, once George Washington entered the Port of Agliers, the Dey insisted that the ship serve as an Algerian transport carrying tribute and goods to Constantinople, fulfilling its own obligations with the Ottoman Empire. Surrounded by the port battery and armed Algerian vessels, Bainbridge felt he could not refuse without facing capture of the ship, imprisonment, and outright war with Algiers. He relented. Algerians came aboard, loaded the ship, and raised the Algerian flag before sailing for Constantinople. News of the incident humiliated the United States and propelled an argument for sending the Navy to protect American merchant shipping.

In May 1801, the U.S. consul to Tripoli informed the Pasha of Tripoli, Yusuf Karamanli, that the United States would not agree to Karamanli’s latest tribute demands. In response, Karamanli formerly declared war on the United States. He ordered the flagstaff in front of the U.S. Consulate removed and the U.S. consul expelled from the country. Karamanli was willing to settle for peace, but at the cost of another payment and an increased annual tribute – a price the United States was no longer willing to pay. Response to a declaration of war was politically more palatable than declaring war, and in February 1802, U.S. Congress authorized President Thomas Jefferson to send the Navy to Tripoli.

Engagement with Tripoli

The first two naval squadrons sent to blockade the harbor of Tripoli proved largely ineffective. Squadron commander Commodore Richard Dale argued that the Navy’s deep draft ships were unable to pursue Tripolitan corsairs along the coast and into the harbor. His successor, Commodore Richard Morris, made little effort to even try to enforce the blockade or stop the corsairs. He was eventually recalled and suspended.

In September 1803, Commodore Edward Preble arrived in Tripoli on board USS Constitution and began aggressively reshaping the conflict. He ordered his ships to enforce the blockade and chase down the corsairs however possible. He began acquiring smaller gunboats that could maneuver along the shorelines and in the harbor. Yet, before Preble could put his plans into action, he faced a crisis that threatened to doom the American effort to win the war.

USS Philadelphia

On October 31, 1803, William Bainbridge, in command of USS Philadelphia, pursued a corsair into Tripoli harbor. In the process, Philadelphia ran hard aground on a reef. While Bainbridge and his crew attempted to free the ship, the Tripolitans began attacking gunboats. Fearful his crew would be slaughtered, Bainbridge surrendered to the Tripolitans. He and his crew remained imprisoned in Tripoli for the next two years.

Despite the crew’s effort to flood Philadelphia, the Tripolitans were able to refloat the ship and bring it into the harbor. Preble realized that if Tripoli succeeded in refitting Philadelphia for battle, it could shift the balance of power toward the Tripolitans. He had to recapture or destroy the ship before Tripoli could make use of it.

In February 1804, a naval crew led by Lieutenant Stephen Decatur snuck back into Tripoli harbor on board a captured Tripolitan ketch, renamed USS Intrepid, disguised as a merchant ship. Guided by a Sicilian pilot who knew the harbor, Decatur and his crew remained hidden from view until Intrepid moored alongside the captured Philadelphia at anchor in the harbor. Decatur and his crew leapt aboard Philadelphia and subdued the small Tripolitan force on the ship. Recapturing the ship proved too risky and would give the Tripolitans time to mount a counter attack. Instead, they quickly planted explosives throughout the ship’s hull before returning to Intrepid. Decatur and his crew escaped out of Tripoli Harbor while Philadelphia burned.

The Shores of Tripoli

Preble bombarded Tripoli and attacked its fleet in the harbor several times in an effort to defeat the Tripolitans. While the attacks had some effect, it was the coordinated assault by land that eventually forced Karamanli to surrender. Karamanli had taken power in Tripoli by deposing his brother, Hamet Karamanli, who was exiled to Alexandria, Egypt. U.S. envoys decided to back Hamet Karamanli in an attempt to regain power over Yusef. A small contingent of U.S. Marines, led by former U.S. consul to Tunis William Eaton, joined Hamet Karamanli and a mercenary army to march along the North African coast from Alexandria. Their intent was to take Derna, then Benghazi, and finally Tripoli itself. At the Battle of Derna, Eaton and his forces were assisted by shore bombardment from three American ships under the command of Master Commandant Isaac Hull. Yusef Karamanli, following his defeat at Derna, decided that the combined forces were more than likely to make it to Tripoli. He negotiated a peace agreement that retained his power.


The exploits of Preble and his fleet of young naval officers became enshrined in the heritage of the fledgling United States Navy. Many of the officers, who later became known as “Preble’s Boys,” went on to earn fame in the War of 1812, including Isaac Hull, James Lawrence, Stephen Decatur, Thomas Macdonough, and William Bainbridge.

The Tripolitan victory did not, however, ensure peaceful free passage for U.S. merchants. European nations were still paying tribute to the Barbary States, and Britain still opposed American trade and navigation in the Mediterranean – a stance that would contribute to the War of 1812. In 1815, Algiers, backed by Britain, attempted to attack U.S. ships again in lieu of receiving tribute. A U.S. Navy squadron led by Stephen Decatur arrived in the Mediterranean and, defeating the Algerian fleet, promptly forced a new negotiated peace with Algiers, as well as Tunis and Tripoli.


1 “III. Report on American Trade in the Mediterranean, 28 December 1790,” Founders Online, National Archives, [Original source: The Papers of Thomas Jefferson, vol. 18, 4 November 1790 – 24 January 1791, ed. Julian P. Boyd. Princeton: Princeton University Press, 1971, pp. 423–430.]

USS Constitution