The U.S. Navy attempted to blockade Tripoli's harbors with a squadron sent by President Jefferson in 1803. After some initial military successes, most notably the capture of the grounded American frigate USS "Philadelphia" in October 1803, the Pasha soon found himself threatened after a raid led by US Navy lieutenant Stephen Decatur to burn and scuttle the "Philadelphia" in Tripoli's harbor. By 1805, following a defeat at the Battle of Derna as well as the allied recruitment of his deposed brother Hamet Karamanli by American army officer and diplomatic consul William Eaton, Karamanli was forced to capitulate. He signed a treaty with American emissary Tobias Lear of the U.S. Department of State that officially ended the war on June 10, 1805.