For many years the United States and European powers paid tribute to the Barbary pirates of the states of Morocco, Tunis, Algeria and Tripoli as the price for sailing their merchant ships on the Mediterranean. By 1801 the United State's payments equalled two million dollars, one-fifth of the nation's revenues. When the demand of Yusuf Caramanli, Pasha of Tripoli, for even larger payments from America was refused, he declared war in May, 1801. Four vessels of the United States's now tiny Navy- the USS President, Philadelphia, Essex and Enterprise were formed into the Mediterranean Squadron and sent to protect American interest in that area. But the small force was hard-pressed to carry out its mission against the powerful Barrbaru pirate fleet.
On October 31, 1803the Philidelphia grounded by pirate ships, floated free and towed into the port as a prize. While negotiations went on trgarding the payments of ransom for release of the crew Lieutenant Stephan Decatur, USN, and a force including Marines under the command of Sergeant Solomon Wren slipped into Tripoli Harbor, overcame the pirates aboard the Philidelphia, burned it to the waterline and escaped without causualty.
The most extraordinary exploit of the war was that of Marine Lietenant Presley N O'Bannon and William Eaton, American diplomatic agent and former army general. Hamet Bey, brother of Yusuf Caramanli and rightful ruler of Tripoli, was in exile in Egypt; Eaton persuaded Hamet to join in a land assault with the purpose of restoring him to his throne. To do this, Eaton and O'Bannon recruited a mercenary force in Alexandria and led them on a daring seven week trek across 600 miles of the Libyan desert. Surviving mutiny, pilfery, religious clashes among the men and terrible thirst and hunger, the two Americans brought their motley force through the desert to the walls of Derna, Yusuf's capital, on April 25, 1805. They sent a messenger into the city with a note ordering the bey, or mayor, to surrender, to which he replied, 'Your head or mine,'
O'Bannon and Eaton informed him that they had no objection to his terms.
The Americans launched an attack supported by a bombardment of the city delivered from three warships in the harbor. O'Bannon's force, made up of Marines and mercenaries, was at the center of the attack on the walls, and quickly came under the heaviest fire. When the mercenaries began to panic, O'Bannon and Eaton led them in a charge against the enemy. Eaton fell wounded, along with three Marines and several mercenaries, but the surprise tactic worked, the startled enemy were caught off balance and began to retreat.
Pressing their advantage, O'Bannon's men soon drove the enemy from the walls. Hamet Bey then led his Arab troops in a successful attack on the bey's castle, and by 16:00 Lieutenant O'Bannon was able to raise the Stars and Strips above the city, the first American flag to fly over a captured fortification in the Old World. This victory contributed to the signing of a favorable peace treaty with the Pasha of Tripolo on June 4, 1805.
In appreciation for O'Bannon's services, Hamet Bey presented him with his own sword, a handsome curved blade with ivory hilt topped by a golden eagle head. The Mameluk sword, so called after the Egyptian sect that forged it, subsequently served as the pattern for swords carried to this day by Marine officers.