<P> On the night of 16 February 1804, Lieutenant Stephen Decatur led a small detachment of U.S. Marines aboard the captured Tripolitan ketch rechristened USS Intrepid, thus deceiving the guards on Philadelphia to float close enough to board her . Decatur's men stormed the ship and overpowered the Tripolitan sailors . With fire support from the American warships, the Marines set fire to Philadelphia, denying her use by the enemy . British admiral, Horatio Nelson, himself known as a man of action and courage, reportedly called this "the most bold and daring act of the age ." </P> <P> Preble attacked Tripoli on 14 July 1804, in a series of inconclusive battles, including a courageous but unsuccessful attack attempting to use Intrepid under Captain Richard Somers as a fire ship, packed with explosives and sent to enter Tripoli harbor, where she would destroy herself and the enemy fleet . However, Intrepid was destroyed, possibly by enemy gunfire, before she achieved her goal, killing Somers and his entire crew . </P> <P> The turning point in the war was the Battle of Derna (April--May 1805). Ex-consul William Eaton, a former Army captain who used the title of "general", and US Marine Corps 1st Lieutenant Presley O'Bannon led a force of eight U.S. Marines and five hundred mercenaries--Greeks from Crete, Arabs, and Berbers on a march across the desert from Alexandria, Egypt, to capture the Tripolitan city of Derna . This was the first time the United States flag was raised in victory on foreign soil . The action is memorialized in a line of the Marines' Hymn--"the shores of Tripoli". The capturing of the city gave American negotiators leverage in securing the return of hostages and the end of the war . </P> <P> Wearied of the blockade and raids, and now under threat of a continued advance on Tripoli proper and a scheme to restore his deposed older brother Hamet Karamanli as ruler, Yusuf Karamanli signed a treaty ending hostilities on 10 June 1805 . Article 2 of the treaty reads: </P>

How did the us win the war against the barbary states