On the morning of 10 May 1801, a detachment of Janissaries marched up the dusty street that ran from the Pasha's palace in Tripoli to the front of the United States Consulate. The acting consul, James Cathcart, watched from the window. The Janissaries arrived at the flagpole, drew their swords, and cut it down. In Tripolitan custom, that was a declaration of war.
The Pasha's name was Yusuf Karamanli. He had been ruler of Tripoli for six years, having seized power from his older brother Hamet in 1795 and exiled him to Alexandria. In December 1800 he had sent an ultimatum to the new American government demanding two hundred and twenty-five thousand dollars per year in tribute, a figure several times the previous annual payment. The new American president, Thomas Jefferson, had been in office for two months and four days. Jefferson had refused.
The cut flagpole was Karamanli's reply.
To understand why this mattered, one has to understand what tribute had become.
For a quarter-century, the four Barbary states (Morocco, Algiers, Tunis, and Tripoli) had been demanding annual payments from European and American merchant powers in exchange for not seizing their ships or enslaving their crews. By the late 1790s, contemporary estimates put American payments to the Barbary states at somewhere between a tenth and a fifth of all federal revenue. The single payment to Algiers in 1795 alone, around one million dollars, came to roughly a fifth of that year's federal budget. President John Adams had paid. Jefferson, who had spent his time as Adams's vice-president arguing that the navy should be slashed and the army abolished, had also written, fifteen years earlier as American minister to Paris, that the cheapest way to deal with the Barbary states in the long run would be a war.
He was about to get one.
Three weeks after Karamanli's flagpole came down, before any news of the declaration could possibly have reached him, Jefferson sent Commodore Richard Dale and a squadron of three frigates and one schooner to the Mediterranean. Their orders were to escort American merchantmen, to maintain peace with the other three Barbary states, and (if Tripoli proved hostile) to blockade Tripoli's harbour. Dale's squadron sailed from Hampton Roads on 1 June 1801. They arrived in Gibraltar on 1 July. The schooner USS Enterprise, commanded by Lieutenant Andrew Sterett, defeated the fourteen-gun Tripolitan corsair Tripoli in a three-hour engagement on 1 August. The Enterprise lost no men. The Tripoli lost thirty.
This was the first naval engagement of an American squadron operating in foreign waters.
It did not end the war. It barely opened it.
For the next two years, American frigates rotated through the Mediterranean trying to make a blockade of Tripoli's harbour stick. The blockade was leaky. American merchantmen continued to be taken. American sailors continued to disappear into the dungeons of the Pasha's palace. In 1803 the command passed to Commodore Edward Preble, who took with him the frigate USS Philadelphia under Captain William Bainbridge.
On 31 October 1803, the Philadelphia was chasing a Tripolitan corsair into shallow water when she ran aground on an uncharted reef just outside Tripoli harbour. Bainbridge tried everything. He cast off three bow anchors. He shifted the guns aft. He jettisoned barrels of water. He sawed off the foremast. The wind held the ship fast. Tripolitan gunboats came out from the harbour. The frigate could not bring her guns to bear. After a few hours of one-sided fire Bainbridge struck his colours and surrendered.
The entire 307-man crew of the Philadelphia were rowed to shore, stripped of their clothing, and crammed into a single chamber inside the Pasha's palace. They would remain there for nineteen months. Six of them would die in captivity.
The Pasha now possessed a captured American frigate. He intended to refit her and use her against the squadron that had been blockading him.
On the night of 16 February 1804, Lieutenant Stephen Decatur, twenty-five years old, sailed a small captured Tripolitan ketch (re-christened the USS Intrepid) into Tripoli harbour with eighty-four hand-picked volunteers concealed below decks. The ketch was disguised as a Maltese trader who had lost her anchor. The Tripolitan watch on the captured Philadelphia let her tie up alongside. As soon as the lines were secured Decatur and his men swarmed over the rail. They cleared the deck of the Tripolitan crew in ten minutes, set the Philadelphia ablaze in another ten, and were back on the Intrepid and rowing for the harbour mouth before the alarm guns of the Pasha's batteries opened on them. The raiding party suffered no American killed. They burned a frigate that had cost the United States forty-seven thousand dollars to build. Vice Admiral Horatio Nelson, the most famous naval officer alive, called it "the most bold and daring act of the age."
It still did not end the war.
What ended the war was a piece of overland improvisation that became a sentence in the United States Marines' Hymn.
In the autumn of 1804 a former American consul named William Eaton persuaded Jefferson to let him try a different idea. Eaton would travel to Alexandria, find the Pasha's exiled older brother Hamet Karamanli (the one Yusuf had pushed off the throne in 1795), raise a mercenary army around him, and march on the eastern Tripolitan port of Derna. If Derna fell, Tripoli's flank would be turned. The threat alone, Eaton hoped, would force Yusuf to negotiate.
Eaton arrived in Egypt in November 1804. He found Hamet hiding from Yusuf's assassins. He recruited around four hundred men: Greek mercenaries, European artillerists, Arab cavalry, and ninety men loyal to Hamet, plus one hundred and ninety camels and their drivers. The American component of his force was eight United States Marines under First Lieutenant Presley Neville O'Bannon.
Eaton marched out of Alexandria on 8 March 1805. He led his column 521 miles across the Libyan desert in fifty-one days, surviving mutinies, hunger, thirst, religious tension, and the periodic insistence of his Arab cavalry that they stop and pray. On 25 April 1805 his column appeared in the hills above Derna. On 27 April, supported by a naval bombardment from three ships of Preble's squadron offshore, Eaton, O'Bannon, and Hamet stormed the city. By midday Derna was theirs. O'Bannon raised the Stars and Stripes over a captured fortification. It was the first time the American flag had been raised in victory over a fortified position in the Old World.
That moment, in due course, became the line "to the shores of Tripoli" in the United States Marines' Hymn.
But Eaton's victory at Derna did not end the war either. What ended the war was a quiet negotiation between the American consul-general Tobias Lear and Pasha Yusuf in Tripoli itself, conducted while Eaton was still holding Derna against repeated Tripolitan counter-attacks. Lear and Yusuf signed the Treaty of Peace and Amity on 4 June 1805. The terms: Yusuf would release the Philadelphia hostages. The United States would pay him sixty thousand dollars in ransom (about one and a quarter million dollars in today's money). The United States would withdraw from Derna. The United States would abandon Hamet Karamanli. The United States would no longer pay annual tribute to Tripoli, but it would continue paying tribute to Algiers, Tunis, and Morocco for another decade.
The Senate ratified the treaty on 12 April 1806.
The war had lasted four years and one month. The Marines' Hymn celebrates it as a triumph. The actual ledger was a captured frigate burned in a daring raid, six American sailors dead in a Tripolitan dungeon, three hundred and one survivors ransomed for cash, an Arab pretender abandoned to his enemies, and a continued tribute to three other Barbary states. The convoy operation that had begun in May 1801 had protected American merchantmen for a season at a time and had left the structural problem (a regional power demanding payment for safe passage of a strait) almost exactly as it found it.
That problem was finally solved by the Second Barbary War in 1815, after Algiers seized two more American merchantmen during the War of 1812.
The Echo
On the afternoon of Sunday 3 May 2026, after high-level peace talks in Islamabad failed to reach a deal, President Donald Trump announced on his Truth Social account that the United States would launch what he called "Project Freedom" beginning the following morning, Middle East time. The American military, he said, would escort foreign vessels stranded in the Strait of Hormuz safely out of "these restricted Waterways, so that they can freely and ably get on with their business." He framed the operation as a "humanitarian gesture." He warned that "any interference will be dealt with."
The structural play is the same one Jefferson set in motion two hundred and twenty-five years ago, almost to the week. A regional power is using the threat of seized commercial shipping through a strategic chokepoint as leverage in a wider negotiation. A new American president, frustrated by the failure of talks and by the price of acquiescence at home, declines to pay the asking price. He sends the navy to escort the merchantmen instead.
Jefferson called it the protection of commerce. Reagan, the last president to run this exact play in this exact strait, called it Operation Earnest Will. Trump calls it Project Freedom. The vocabulary changes. The operation is recognisable.
The thing the vocabulary cannot tell you in advance is whether the convoy operation will be a season's improvisation or a four-year war.
Last time, it began with one frigate engagement, then dragged on through a captured ship, an overland march that became a national myth, and a treaty that still required a ransom. The line about the shores of Tripoli came out of it. So did the dead sailors who never came home, and the long understanding that escorts protect ships but do not change the structural reason a smaller power was holding shipping in the first place.
Project Freedom is scheduled to begin tomorrow morning Middle East time.
Last time, the convoy operation took four years.
This time, what comes next?