arrived at Gibraltar on 12 September, where Preble waited for the other ships of the squadron. His first order of business was to arrange a treaty with Sultan Slimane of Morocco, who was holding American ships hostage to ensure the return of two vessels that the Americans had captured. Constitution and departed Gibraltar on 3 October and arrived at Tangier on the 4th. Adams and arrived the next day. With four American warships in his harbor, the Sultan was glad to arrange the transfer of ships between the two nations, and Preble departed with his squadron on 14 October, heading back to Gibraltar. Battle of Tripoli Harbor ran aground off Tripoli on 31 October under the command of William Bainbridge while pursuing a Tripoline vessel. The crew was taken prisoner; Philadelphia was refloated by the Tripolines and brought into their harbor. To deprive the Tripolines of their prize, Preble planned to destroy Philadelphia using the captured ship Mastico, which was renamed . Intrepid entered Tripoli Harbor on 16 February 1804 under the command of Stephen Decatur, disguised as a merchant ship. Decatur's crew quickly overpowered the Tripoline crew and set Philadelphia ablaze. Preble withdrew the squadron to Syracuse, Sicily, and began planning for a summer attack on Tripoli. He procured a number of smaller gunboats that could move in closer to Tripoli than was feasible for Constitution, given her deep draft. Constitution, , , , , the six gunboats, and two bomb ketches arrived the morning of 3 August and immediately began operations. Twenty-two Tripoline gunboats met them in the harbor; Constitution and her squadron severely damaged or destroyed the Tripoline gunboats in a series of attacks over the coming month, taking their crews prisoner. Constitution primarily provided gunfire support, bombarding the shore batteries of Tripoli—yet Karamanli remained firm in his demand for ransom and tribute, despite his losses. Preble outfitted Intrepid as a "floating volcano" with of gunpowder aboard in a final attempt of the season. She was to sail into Tripoli harbor and blow up in the midst of the corsair fleet, close under the walls of the city. Intrepid made her way into the harbor on the evening of 3 September under the command of Richard Somers, but she exploded prematurely, killing Somers and his entire crew of thirteen volunteers. Constellation and President arrived at Tripoli on the 9th with Samuel Barron in command; Preble was forced