In this state of things, he endeavored to amuse the Americans with propositions of peace; and the sovereigns of Algiers and Tunis being in consequence engaged by him as mediators, sounded the consuls of the United States at their respective courts, as to the dispositions of their government. Nothing definite could be drawn from either: they merely hinted what they hoped and believed, that nothing would be paid, either for peace or as tribute; and the mediators were not disposed to continue their good offices on such grounds. The Emperor of Morocco also undertook to load the ships lying at Gibraltar with wheat, and to procure for them, as his own property, American passports for Tripoli. These were however refused by the consul of the United States at Tangiers, and by the commander of their squadron; at which the Emperor was so much incensed, that he ordered the American consul to quit his dominions, and commenced hostilities against their commerce. Morat Rais, the Scotch renegade, was however conveyed on board a British ship of war to Malta, whence he easily passed over to Tripoli, much to the disappointment of Eaton, who considered him as the chief exciter of the difficulties, and as the only person in the Pasha's service at all acquainted with naval affairs. But very little advantage was derived from his skill; worthy Peter had indeed found it much easier to profit by the licenses of his new creed, than to submit to its restrictions, and some of his old propensities had probably been revived during his residence at Gibraltar; for after his return to Tripoli, he remained some time in a constant state of intoxication.

Yusuf still carried on his preparations for defence with great energy. Moors and Arabs were called in and enrolled, some principal persons from each village or tribe being kept as hostages in the castle. The Swedish and American prisoners were employed in repairing the fortifications, making gun carriages, &c.; and as no vessels could be built in Tripoli, some were purchased and prepared for use as cruisers.

But he had another object in view, of still greater importance; which was to get Hamet again in his power. In this the Bey of Tunis consented, it is said reluctantly, to aid him. Hamouda had no objection to see the Pasha of Tripoli in an embarrassed state, or indeed to have Hamet placed on the throne; but he was little inclined to favor the pretensions of the latter on the score of legitimacy, he himself being a usurper, and the heir to the throne of Tunis by regular descent, being a prisoner in his castle; he also apprehended that the success of Eaton's plan would encourage other christian powers to interfere in the concerns of Barbary. It was therefore proposed to Hamet to return to the government of Derne, which with his family, Yusuf offered to restore to him; and the proposition was accompanied by a hint that he would receive no farther supplies in case he remained in Tunis. The poor Prince thus driven to extremities was obliged to yield; a Russian vessel was in consequence engaged to convey him to Derne, and he was to be escorted by a guard of honor consisting of forty Tripoline soldiers, who had been sent to Tunis for the purpose.

Had these arrangements proceeded much farther, there can be little doubt as to what would have been the fate of Hamet; but information of them was conveyed to Eaton by the Sapatapa, whose services he had engaged before leaving Tunis. He was then at Leghorn, awaiting the determination of his government; no answer to his communication with regard to the restoration of Hamet had arrived, but he had just received a letter from the Secretary of State which authorized him to suppose that his plan would be favorably received. Therefore considering that the present circumstances were too important to permit delay, he hastily purchased and manned a vessel of fourteen guns, called the Gloria, and sailed in her for Tunis, where he arrived on the 18th of March, 1802. The Bey instantly demanded of him a passport for Hamet and his suite, who were on the point of departure. This he of course refused. Hamouda became outrageous, threatened to imprison him, and to declare war against the United States; but threats only suggested new resources to this energetic man, and his determination was soon taken. In order to secure himself however, he called a consultation of the principal Americans then in Tunis who having approved his measures, the Gloria was despatched with letters, to be delivered to the commander of the first American ship of war which could be met with, communicating the state of the affair, and requesting assistance to prevent the Prince from entering the Tripoline territory. The frigate Boston was luckily soon found; her commander, O'Neill, readily agreed to what was requested, and having commissioned the Gloria as an United States ship, to act against Tripoli, he sailed for the coast of Derne, in order to intercept the vessel carrying Hamet. The Gloria returned in a few days to Tunis. In the meantime Eaton had, by a promise of ten thousand dollars to the Sapatapa, to be given in case of the success of his plans, opened a communication with the Tripoline Prince, whom he was not permitted to see. Every means was used to operate on his hopes, his fears, and even his superstitious feelings. The prospects of his restoration by the aid of the United States, were contrasted with the danger, nay the certainty, of death, to which he exposed himself, by confiding in his cruel and perfidious brother; the prophecies of a Marabout, respecting his being replaced on the throne of Tripoli, by a people from the setting sun, were gravely and ingeniously repeated; and when all these representations had proved ineffectual, he was plainly assured that he would not be allowed to reach Derne, but that he would be attacked on his passage by the American squadron, and treated if taken, as a Tripoline enemy. The miserable exile had no other resource than to throw himself on the protection of the American consul. It was therefore arranged that he should sail ostensibly for Derne, furnished with a passport and also a private letter from Eaton, to be delivered to any American commander or other authority with whom he might fall in; and that the vessel should on the way put into Malta, under pretence of avoiding the Americans and Swedes. This was done, and Hamet landed safely at that island on the 11th of April.

The news of his arrival excited the strongest interest throughout Barbary. The Bey of Tunis pronounced that all was over with Yusuf, unless he made peace at once. The people of Tripoli were also much excited, as they expected an attack to be immediately made. Yusuf, though greatly alarmed, continued his preparations for defence; and it is said, assembled in the course of the summer, fifty thousand troops about the city; this was probably however, an exaggerated statement. His naval force ready for sea, amounted to one vessel of eighteen guns, one of sixteen, three of fourteen, and one of ten; with these, Morat Rais when a little sobered, proposed to sail for Gibraltar, and after releasing and manning the two vessels there lying, to put out on the Atlantic, where he expected to reap a rich harvest of prizes. In order to escape observation, he had provided his sailors with the dresses of christian nations; but this ruse, as well as the plan it was intended to promote, were soon communicated to the watchful Eaton, and by him to the officers of the squadron.

However Tripoli was so carelessly blockaded, that some of the vessels got to sea, one of which captured the brig Franklin, of Philadelphia, and carried her into Algiers, where an attempt was made to dispose of her and her crew. The American Consul at Algiers, remonstrated against this proceeding, and endeavored to procure the surrender of the brig and men, on the grounds that the Dey was bound, as guaranty of the peace between the United States and Tripoli, to cause her delivery. The Dey replied, that he had engaged to act only as mediator, but not to employ force in having the treaty respected; and that moreover the principal parties to it being then at war, and the United States actually holding Tripoli under blockade, the treaty as well as the guaranty were in fact at an end. However, after some delay, the Tripoline was ordered to quit the place, which he did, taking his prize with him, to the little port of Biserta, in the Tunisian territory, sixty miles from the capital; and the next day (July 8) the brig and her crew were advertised for sale at Tunis. What were the feelings of Eaton on this occasion may be conceived; his application to Commodore Murray who commanded the squadron nominally blockading Tripoli produced no effect; and to his mortification he saw the cruiser quit the place with the American captives in irons, (the brig being left at Biserta,) and heard of its safe entry into Tripoli actually in sight of the frigate Constellation. As a last resource, in order to alleviate the miseries of their captivity, he wrote a moderate and conciliatory letter to the Pasha, recommending him not to allow the American prisoners to be sold as slaves, but to have them treated with lenity, to refrain from farther hostilities, and even to receive Mr. Morris, the captain of the Franklin, as the agent of the United States until affairs could be arranged.

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.