Nine days after the Thomas Jefferson took office, his administration received a demand from the Pasha of Tripoli to increase the amount of tribute that was paid him, or else he would declare war. Jefferson's inclination, despite his party's policy of dismantling the Navy, was to respond with force. This inclination was further supported when a ship, the "George Washington," under the command of Captain William Bainbridge, was forced to convey the yearly tribute to Constantinople, after having brought it to Tripoli.
America’s first step was to send a small squadron, three frigates and a schooner, to show the American flag off the coast of Tripoli. Then, the American squadron instituted a loose blockade of Tripoli. One squadron was commanded by Commodore Dale, and was relieved by a squadron led by Commodore Richard Morris. Neither squadron did much more than show the flag. Morris was relieved, and replaced by Commodore Edward Prebble, who was on board the flag ship "Constitution”. For the first time, the squadron included shallow draft ships, which had the capacity to provide inshore bombardment.
Prebble was determined to take a more active approach than his predecessors. He made a show of force off the coast of Tangiers, and sent the "Philadelphia”, under the command of Captain Bainbridge, to blockade Tripoli. On November 1, the "Philadelphia" pursued a Tripolitan ship toward the harbor. While pursuing her, the "Philadelphia" ran aground. All attempts at refloating her failed, and her crew of 307 was forced to surrender. The Tripolitans later managed to refloat the frigate.
Prebble then faced a major dilemma: what should he do about the captured ship and its crew? He developed a plan to destroy the ship as she lay anchored in Tripoli Harbor. He had earlier captured the "Mastico”, a Tripolitan ketch. The "Mastico" was renamed the "Intrepid”, and, on February 16, 1804, Lt. Stephen Decatur led the ship straight into Tripoli Harbor. He and the crew managed to overpower the guard on the "Philadelphia”, and succeeded in setting it on fire without any casualties.
Prebble then began an intensive blockade on Tripoli, as well as successive bombardments of the harbor. Prebble was replaced with Samuel Barron, who was quite ill. Barron was in turn replaced by William Eaton, who hired a mercenary Arab army in Egypt. They crossed the desert and successfully captured the Tripolitan coastal town of Derna. The war was then brought to a negotiated end.