The Barbary Wars
1801–1815 · “To the Shores of Tripoli”
America's first overseas military action. 700+ Americans enslaved by North African pirates. A navy sent 5,000 miles to fight. Eight Marines marched 500 miles across a desert. “Millions for defense, not one cent for tribute” — except for the tribute we kept paying until 1815.
The Cost: Fighting Was Cheaper Than Paying
The Barbary Wars present a rare case where military action was genuinely more cost-effective than the alternative. The US was paying up to one-sixth of its federal budget in tribute to the Barbary States. Two wars and $100M+ later (in today's dollars), the tribute stopped permanently. Sometimes the math actually works — though the human cost of 700+ enslaved Americans and dozens of combat deaths shouldn't be reduced to a ledger entry.
| Category | Amount (2024$) |
|---|---|
| Naval Operations (First War) | $60M |
| Ransom for USS Philadelphia Crew | $12M |
| Eaton's Overland Expedition | $5M |
| Naval Operations (Second War) | $15M |
| Pre-War Tribute Payments | $40M+ |
Context: The Barbary System
For centuries, the Barbary States of North Africa — Morocco, Algiers, Tunis, and Tripoli (modern Libya) — operated a system of state-sponsored piracy. Ships that didn't pay tribute were seized, their cargoes confiscated, and their crews enslaved. European powers paid annual tribute as a cost of doing business in the Mediterranean.
During the colonial era, American ships were protected by British tribute payments and the Royal Navy. After independence, that protection vanished. American merchants in the Mediterranean were on their own — and the Barbary corsairs immediately took advantage.
Between 1785 and 1793, Algiers alone captured 13 American ships and enslaved over 100 American sailors. Some were held for over a decade. The ransoms demanded were staggering — the 1795 treaty with Algiers cost $1 million (approximately $25 million today), plus a 36-gun frigate as a gift, plus annual tribute in naval stores. This single treaty consumed roughly one-sixth of the entire federal budget.
The question that divided the early republic: pay tribute indefinitely, or build a navy and fight? Jefferson argued for fighting as early as 1785. Adams preferred diplomacy and tribute as cheaper. When Jefferson became president, he got his war — and discovered it was neither quick nor cheap.
First Barbary War (1801-1805)
Tribute & Humiliation
After independence, American merchant ships in the Mediterranean lose the protection of the Royal Navy. Barbary corsairs from Morocco, Algiers, Tunis, and Tripoli seize American ships and enslave their crews. The US, with no navy, pays tribute — $1 million to Algiers alone in 1795 (1/6 of the entire federal budget). Over 700 Americans are held as slaves in North Africa.
Building a Navy
The Quasi-War with France forces the US to build a navy. The same frigates built to fight France — Constitution, Constellation, Congress — become available for Mediterranean service. For the first time, the US has the military capability to challenge the Barbary states.
Tripoli Declares War
Pasha Yusuf Karamanli of Tripoli, unsatisfied with the level of American tribute, declares war by cutting down the flagpole at the US consulate. President Jefferson, despite his small-government philosophy, sends a naval squadron to the Mediterranean — the first projection of American military power overseas.
Inconclusive Blockade
The US Navy blockades Tripoli but achieves little. The blockade is leaky, commanders are cautious, and Tripoli's harbor defenses are formidable. The war drags on without decisive action. Jefferson discovers that projecting power 5,000 miles from home is expensive and difficult — a lesson every subsequent president has also learned and ignored.
USS Philadelphia Captured
The frigate USS Philadelphia runs aground in Tripoli harbor and is captured with its entire crew of 307. Captain William Bainbridge and his men become prisoners. The Philadelphia — one of America's most powerful warships — is now a prize of Tripoli, turned against the American blockade. It's the worst US naval disaster until Pearl Harbor.
Decatur Burns the Philadelphia
Lieutenant Stephen Decatur leads 74 volunteers in a captured Tripolitan ketch (renamed Intrepid) into Tripoli harbor at night. They board the Philadelphia, overwhelm the guard, and set the ship ablaze — destroying it so it can't be used against the US. Horatio Nelson calls it "the most bold and daring act of the age." Decatur becomes a national hero at age 25.
Bombardment of Tripoli
Commodore Edward Preble launches five major bombardments of Tripoli. The attacks damage the city but don't break the Pasha's will. In September, the USS Intrepid — packed with explosives as a fireship — enters the harbor to destroy the Tripolitan fleet. It explodes prematurely, killing all 13 American volunteers aboard. The cause of the premature explosion remains a mystery.
Eaton's March Across the Desert
William Eaton, US consul to Tunis, leads one of the most audacious military operations in American history. With 8 Marines, a few hundred Arab and Greek mercenaries, and Hamet Karamanli (the Pasha's deposed brother), Eaton marches 500 miles across the Libyan desert from Alexandria, Egypt to capture the city of Derna. The Marines' Hymn — "to the shores of Tripoli" — commemorates this action.
Battle of Derna
Eaton's ragtag force, supported by naval gunfire, captures Derna — the first time the American flag is raised over a foreign fortification. It's a remarkable achievement: a handful of Marines and mercenaries seizing a city in a land war on another continent. The capture threatens the Pasha's rule and forces him to negotiate.
Treaty of Peace
Pasha Yusuf agrees to peace. The US pays $60,000 ransom for the Philadelphia's crew (technically not "tribute" but practically identical). The treaty ends tribute payments to Tripoli. However, the US continues paying tribute to Algiers, Tunis, and Morocco. Eaton is furious — he believes another week would have toppled the Pasha entirely. Hamet Karamanli, the US-backed pretender, is abandoned.
Second Barbary War (1815)
The Second Barbary War was swift, decisive, and everything the First was not. With the War of 1812 over, America had a battle-hardened navy and a score to settle.
Barbary States Exploit US Weakness
During the Embargo Act crisis and War of 1812, the US Navy is occupied elsewhere. Algiers takes advantage, seizing American ships and enslaving crews again. Dey Omar of Algiers declares war on the US in 1812, emboldened by British suggestions that the US is too weak to respond.
Congress Authorizes Force
With the War of 1812 over, Congress authorizes naval action against Algiers. Two squadrons are dispatched — one under Stephen Decatur (now a Commodore), the other under William Bainbridge (redeemed after the Philadelphia disaster).
Decatur Captures the Algerian Fleet
Decatur's squadron intercepts the Algerian flagship Meshuda off Cape Gata, Spain, and captures it in a brief engagement. The Algerian admiral, Rais Hammida, is killed. Decatur then captures the brig Estedio. In less than a week, the Algerian navy is effectively destroyed.
Dictating Terms
Decatur sails into Algiers harbor and presents his terms: no more tribute, release of all American prisoners, compensation for seized property. The Dey, with his fleet destroyed, has no choice. Decatur delivers the same terms to Tunis and Tripoli. The era of Barbary tribute from the United States is over permanently.
Key Figures
The small-government philosopher who sent the Navy across the Atlantic. Jefferson had personally witnessed Barbary piracy's effects as ambassador to France. He believed fighting was cheaper than tribute — and he was right, eventually. The Barbary Wars are the first example of an American president using military force overseas without a formal war declaration.
The dashing young officer who burned the Philadelphia and later forced Algiers to surrender. Famous for his toast: "Our country! In her intercourse with foreign nations, may she always be in the right; but our country, right or wrong." Killed in a duel in 1820 at age 41 — America's first military celebrity.
Led the extraordinary overland march to Derna with 8 Marines and a motley force of mercenaries. Eaton was equal parts brilliant and unhinged — a combination that made him perfect for a mission no sane person would attempt. He died embittered in 1811, convinced the government had betrayed him and his allies.
Commanded the Mediterranean squadron 1803-1804. Though he never achieved the decisive victory he sought, Preble trained an entire generation of naval officers — "Preble's Boys" — who would dominate the War of 1812. His aggressive tactics transformed the Navy's culture from cautious to combative.
Seized power by murdering one brother and exiling another (Hamet). His demand for increased tribute triggered the First Barbary War. Held the Philadelphia's crew hostage for 19 months. Eventually made peace when Eaton's expedition threatened his throne.
“From the Halls of Montezuma to the Shores of Tripoli”
The Barbary Wars gave the Marine Corps its identity. The Battle of Derna — where 8 Marines marched 500 miles across the Libyan desert and captured a fortified city — became the foundational myth of Marine expeditionary warfare. The Mameluke sword carried by Marine officers today commemorates this battle, presented (according to tradition) by Hamet Karamanli to Lieutenant Presley O'Bannon after the victory.
The Marine Corps Hymn — the oldest official song in the US military — opens with “From the Halls of Montezuma to the shores of Tripoli.” The Tripoli reference comes from Derna. “Halls of Montezuma” references the Mexican-American War (1847). The Hymn literally defines the Marines by two wars of overseas intervention — establishing from the very beginning that the Corps exists to project American power abroad.
America's First Regime Change Operation
William Eaton's expedition to install Hamet Karamanli as ruler of Tripoli was America's first attempted regime change — a covert operation to replace an unfriendly government with a compliant one. The playbook: find a disaffected exile, promise him power, use American military force to install him, then abandon him when politically convenient.
It worked militarily. Eaton captured Derna and threatened the Pasha's rule. But the Jefferson administration, preferring a quick peace to a prolonged campaign, negotiated directly with Pasha Yusuf — effectively betraying Hamet, who was abandoned at Derna.
The pattern — use a local ally, achieve military success, then abandon the ally for diplomatic convenience — would repeat throughout American history: the Bay of Pigs, the Kurds (multiple times), the South Vietnamese, the Afghan allies left behind in 2021. The Barbary Wars established regime change as an American tool and allied abandonment as an American habit.
Legacy: The Template for Forever
The Barbary Wars are often presented as a simple story of American heroism against piracy. The reality is more nuanced and more consequential:
- •First overseas military intervention — establishing the precedent that the US would project force globally.
- •First regime change attempt — and first abandonment of a local ally.
- •Marines' expeditionary identity — "every clime and place" begins at Derna.
- •The Navy as permanent institution — Mediterranean deployments continue to this day.
- •Presidential war power — Jefferson sent the Navy without a formal declaration of war.
- •The gap between rhetoric and reality — "not one cent for tribute" while paying $60,000 ransom.
The Barbary Wars were, in many ways, a preview of everything to come. Overseas intervention, regime change, allied betrayal, the gap between patriotic rhetoric and messy reality — it's all here, in 1801, at the very beginning. The shores of Tripoli were just the first shore.
Frequently Asked Questions
What were the Barbary Wars?
The Barbary Wars were two conflicts (First: 1801-1805, Second: 1815) between the United States and the Barbary States of North Africa (Morocco, Algiers, Tunis, and Tripoli). The wars were fought to end the practice of paying tribute to Barbary pirates in exchange for safe passage of American merchant ships in the Mediterranean. They were America's first overseas military actions and established the US Navy and Marines as expeditionary forces.
What does "shores of Tripoli" mean in the Marines' Hymn?
The "shores of Tripoli" in the Marines' Hymn refers to the Battle of Derna (April 27, 1805) during the First Barbary War. William Eaton led 8 US Marines and several hundred mercenaries on a 500-mile march across the Libyan desert to capture the city of Derna. It was the first time the American flag was raised over a foreign fortification, and it established the Marines' reputation as an expeditionary force capable of operating far from home.
How much did the Barbary Wars cost?
The Barbary Wars cost approximately $3 million in contemporary dollars (over $100 million adjusted). However, the total cost of the Barbary crisis is much higher when including pre-war tribute payments — the US paid over $1.25 million in tribute to the Barbary States between 1785 and 1801, representing up to one-sixth of the federal budget. The wars ultimately proved cheaper than perpetual tribute.
What happened to the USS Philadelphia?
The frigate USS Philadelphia ran aground in Tripoli harbor on October 31, 1803, and was captured with its entire crew of 307. The crew was enslaved for 19 months. On February 16, 1804, Lieutenant Stephen Decatur led a raiding party that boarded and burned the Philadelphia in one of the most famous naval raids in history. The crew was eventually ransomed for $60,000 in the 1805 peace treaty.
Who said "millions for defense, not one cent for tribute"?
The phrase is attributed to Robert Goodloe Harper during the XYZ Affair (1797-1798), not the Barbary Wars specifically. However, the sentiment became closely associated with the Barbary conflict. Ironically, the US continued paying tribute to some Barbary states even during and after the First Barbary War, and paid $60,000 ransom for the Philadelphia's crew — making the rhetoric somewhat hollow until Decatur finally ended all tribute in 1815.
Why are the Barbary Wars important?
The Barbary Wars established the US as a power willing to project military force overseas. They proved the US Navy's capability in distant waters, created the Marine Corps' expeditionary identity, and demonstrated that force was more cost-effective than tribute. They also set precedents for presidential war-making power, regime change operations (Eaton's attempt to install Hamet Karamanli), and the abandonment of local allies — patterns that would repeat for the next two centuries.
Related Pages
Sources
- Frank Lambert — The Barbary Wars: American Independence in the Atlantic World (2005)
- Joshua London — Victory in Tripoli: How America's War with the Barbary Pirates Established the US Navy (2005)
- Ian Toll — Six Frigates: The Epic History of the Founding of the US Navy (2006)
- Naval History and Heritage Command — Barbary Wars Records
- Marine Corps History Division — Battle of Derna
- Congressional Research Service — Instances of Use of US Armed Forces Abroad