The American ships of war soon after quitted that coast, to which they did not return until the spring of 1803, leaving the consuls to defend as they could their refusal to grant passports for Tripoli. Eaton maintained his ground with obstinacy, the others yielded; the consul at Algiers gave his passport to vessels which he knew were to be laden with wheat for Tripoli; and the agent at Tangiers actually gave his, to one of the Tripoline vessels of war which had been lying at Gibraltar, and which accordingly sailed for Tripoli, laden with wheat from Morocco. These circumstances when known, put an end to all consideration and respect for the American consul, and even for the American name in Tunis; as Eaton says, "it was a matter of exultation at that piratical court, that the American consul had been abandoned by his countrymen, and the occasion was seized to humble his pride." He had involved himself in great expenses in furtherance of his plans respecting Hamet, without authorization from his government; a portion of the sums expended had been obtained in Tunis, and the ten thousand dollars promised to the Sapatapa as a bribe, and which had been forfeited by his treachery, were now demanded as the balance in a mercantile transaction. Neither party could bring any written proofs, the case was therefore referred to the Bey, who of course decided against Eaton, and the successful minister on retiring from the hall of justice, sarcastically remarked, that in Tunis they knew how to keep consuls to their promises. The demand for a frigate from the United States was renewed, which Eaton, in spite of threats and attempts to bribe him, having refused even to submit to his government, his brig, the Gloria, was seized and charged with the conveyance of a letter to the President, containing the requisition; she however got safely to Leghorn, where she was sold.

All these things Eaton could only represent to his government, which he did in forcible language; he demonstrated the weakness of the Barbary States, and showing that they had not a single ship capable of withstanding a sloop of war, again urged the employment of smaller vessels. Finally he expressed a desire to "be supported or displaced," and that "if farther concessions were to be made, he might not be the medium through which they were to be presented."

Although Eaton almost despaired of procuring the means for executing his plan upon Tripoli, yet he maintained an active correspondence with Hamet, for whose support he advanced the necessary funds. Soon after the arrival of that Prince at Malta, he had met with Captain O'Neill, of the Boston, who appeared ready to forward the project by every exertion in his power, as also did the Swedish commander. Commodore Murray too, who came there with the Constellation, thought better of the affair, and offered to take him to Derne; but he preferred going privately, in an English brig, which he had chartered, and at length sailed in November (1802) for that place, where he was received with every demonstration of affection by the inhabitants, and the surrounding Arab tribes. He was soon after joined by a nephew, who had been living in exile in Egypt, at the head of a considerable force; and thus considering himself strong enough to commence his march upon the capital, he despatched a confidential messenger to Eaton, in order to inform him of the state of his affairs, and to hasten the arrival of the expected succors; he even assured him that the appearance of a single American frigate before Tripoli, would be sufficient to cause its surrender.

The receipt of this information must have been martyrdom to Eaton; he restrained his vexation as he could, and kept the messenger concealed in his house. At length, on the 22d of February, 1803, Commodore Morris appeared off the harbor in the frigate Chesapeake, and soon after landed with one or two of his officers. The object of his visit was to contest the demand made by the Bey, for the restoration of some Tunisian property, which had been seized in an Imperial vessel while it was endeavoring to enter Tripoli. After some discussion, it was agreed that the property should be restored; but this compliance only emboldened the Bey and his minister, to demand immediate payment of all Eaton's debts in Tunis, real or pretended; and on refusal of both the commodore and the consul, the former was actually detained in Tunis, and not allowed to communicate with his ship. As they were thus completely in the power of the Bey, who had besides, at least the semblance of right in his pretensions, nothing was left but to pay the money, which was done. During these proceedings Eaton by his animated remonstrances, and by the charges which he openly advanced against the minister, had so far irritated the Bey, that he ordered him immediately to quit the place, declaring, "that he was a man of a good heart, but a wrong head; too obstinate and violent;" and that he "must have a consul more congenial with the Barbary interests." Eaton therefore took his leave, and quitted Tunis on the 10th of March. Before his departure he had introduced Hamet's agent to the commodore, and the plans and resources of that Prince were exposed to him. Morris however, either did not partake of Eaton's conviction relative to the practicability of the scheme, or did not anticipate from its success results so favorable to his country as to warrant his interference. He therefore refused all immediate assistance, and only promised to appear before Tripoli in June, when, "provided an equivalent were guarantied to the United States in the event of success," he would furnish Hamet with "twenty barrels of powder." He did indeed appear before Tripoli about the end of May, with five frigates and a schooner; but, with the exception of an unsuccessful attempt to destroy some vessels laden with wheat, which had been chased into the harbor of Old Tripoli, (the ancient Sabrata) he confined himself entirely to negotiations. Yusuf demanded two hundred thousand dollars and the expenses of the war "for a peace," and on this being refused, he told the Commodore that "the business was at an end, and that he must depart." Morris quitted the coast immediately, leaving two frigates to blockade the port; he soon after received orders to return to America, where he was tried before a court martial, and received severe censure for his inactivity and incapacity. Captain John Rodgers who was left in command, succeeded on the 21st of June in destroying the Tripoline ship of war of twenty-two guns, which as before stated had sailed from Gibraltar, loaded with wheat by the Emperor of Morocco. With Hamet no communication appears to have taken place.

Eaton arrived at Boston on the 5th of May 1803, and in June proceeded to Washington, to adjust his accounts and to urge the adoption of more rigorous measures towards the Barbary powers. He appears to have been coldly received. His expenses incurred on Hamet's account, were not allowed by the Department of State, nor indeed were they completely admitted until they had been before Congress during its two ensuing sessions. His desire to be relieved from his situation, unless a more determined course were pursued, was considered as a resignation of his office, in which Mr. Cathcart had been appointed to succeed him; and instructions had been forwarded to that gentleman to negotiate both with Tripoli and Tunis, on the amount to be paid as presents and yearly tribute. To crown all, a letter had been written to the Bey, in which Eaton was declared "to have gone beyond the letter and spirit of his instructions," and his acts were "disclaimed as in opposition to his orders." With all these circumstances he was not indeed made acquainted immediately; but the manner of his reception did not impress him favorably with respect to the members of the Administration, and much increased his natural irritability.

The American government did not however neglect to take advantage of his information and experience; and news having arrived of some success on the part of Hamet, it was determined to send a much larger force to the Mediterranean. This squadron sailed on the 13th of August, under the command of Commodore Preble; and after halting a few days in the Straits of Gibraltar, in order to settle affairs with the Emperor of Morocco at Tangiers, it joined the other ships off Tripoli in October. A circumstance here occurred of the most disastrous nature, and which probably contributed more than any other, to prevent the dethronement of Yusuf, or the termination of the differences between the United States and the Barbary nations, in a manner entirely satisfactory to the former. The frigate Philadelphia, while in chase of a Tripoline ship on the 31st of October (1803), struck upon a rock at the entrance of the harbor of Tripoli with so much violence, that she remained immoveable by any means at the disposition of the crew, and consequently defenceless. Her situation being ascertained in the city, a number of gun boats were instantly sent out, to which, as no resistance could be made, she was of necessity surrendered. The crew, consisting of three hundred, with their captain Bainbridge, were transferred to the city; two days after the ship was got off, towed into port, and being easily repaired, was likely to prove a valuable accession to the naval strength of the Pasha.

The capture of the Philadelphia was however calculated to produce a moral effect infinitely more injurious to the American cause than the mere loss of the ship, and her acquisition by Tripoli. The skill, and even the personal bravery of the naval men of the United States, had been rendered doubtful by the proceedings of the two previous years; these doubts now assumed the form of a certainty, the most unfavorable and mortifying; and unless something had been immediately done to retrieve the honor of the flag, it must have quitted the Mediterranean in disgrace, or designated every ship over which it waved, as the bearer of tribute.

But there were noble spirits in the American squadron who determined that this should not be. On the night of the 15th of February, 1804, Lieutenant Stephen Decatur, accompanied by seventy resolute men, entered the harbor of Tripoli, in a small schooner which he had previously taken and called the Intrepid, and succeeded in boarding the Philadelphia, then lying under the guns of the castle. In a few minutes the Tripoline crew were overpowered; many were killed, others swam to the shore, and communicated the astounding facts. A terrible fire was instantly opened upon the ship from the castle and batteries, aided by those of two vessels lying near; and it being impossible to carry off the Philadelphia, she was set on fire. The Americans retreated to the Intrepid; a breeze fortunately sprung up; they were soon beyond the power of their enemies, and reached the ship which awaited them, without losing a man. The Philadelphia was totally destroyed.

This heroic achievement restored confidence to the Americans, and determined Commodore Preble to make a desperate attempt upon the city. His force had however been much reduced by the loss of the Philadelphia and the recall of other ships; and judging that an addition was necessary to afford any prospect of success, he proceeded to Naples, where he obtained from the King the use of two bomb vessels and six gun boats. These were strong, heavy, flat bottomed vessels, bad sailers, but manageable by oars, and well calculated for harbor operations. The gun boats mounted each a long twenty four pounder, and were manned by thirty-five men; the bombs carried thirteen inch mortars and forty men; several Neapolitan gunners and bombardiers were also engaged to assist in working them. The whole American force thus amounted to one frigate, (the Constitution,) three brigs, three schooners, two bombs, and six gun boats, carrying in all about one hundred and twenty guns, and one thousand and sixty men; and with this armament Preble appeared before Tripoli on the 25th of July, 1804.

Yusuf was not however taken unawares, and he had made formidable preparations for resistance. The number of his troops in the city was supposed to be twenty-five thousand; the batteries mounted one hundred and fifteen pieces of cannon; besides which, the harbor was defended by nineteen gun boats, two gallies, two schooners of eight guns each, and a brig of ten guns.