The result of all these communications, was a determination on the parts of the Commander of the forces, and the Consul General, to abandon the co-operation with Hamet and to enter into a negotiation with Yusuf. Barron considered the moment the most favorable for concluding peace, on advantageous terms, as the capture of Derne must doubtless have produced a powerful effect on the Pasha's mind; and although discarding the idea of yielding any point of national honor or advantage, to obtain the liberation of the prisoners, he yet contended that "the lives of so many valuable and estimable Americans should not be sacrificed to abstract points of honor." Mr. Lear in reply, conceived it his duty, "to open and bring to a happy issue, a negotiation for peace consistent with the tenor of their instructions, whenever the Commander of the American naval forces in the Mediterranean should judge the occasion proper and favorable;" he would therefore at once proceed to Tripoli for the purpose; he could not however believe that any impression favorable to the United States had been made on Yusuf, by the measures in concert with his brother, unless the bravery and perseverance of the Americans at Derne, had given him a proof of what might be done against him without extraneous aid.

Preparations were instantly made to carry both these resolutions into effect. The Hornet was sent back to Derne with despatches notifying Eaton of the projected negotiation, directing him at the same time explicitly to inform Hamet, that all supplies of arms and money were at an end, and he must trust entirely to his own resources and exertions; that as he was now "in possession of the most valuable province of Tripoli," and at the post from which he was driven when he first solicited the assistance of the United States, all had been done for him which he had a right to expect; but that endeavors would be made to stipulate some conditions in his favor, provided they could be obtained "without any considerable sacrifice of national advantage." Eaton and his companions were not indeed directly ordered to retire from Hamet's service, but the expressions of the letter conveyed a hint that they were expected to do so which could not be mistaken; in addition to which, Captain Hull, who commanded the ships at Derne, was required to proceed with them immediately to Tripoli.

The necessary arrangements being also made for carrying Mr. Lear to Tripoli, he sailed in the Essex frigate for that place, off which he arrived on the 26th of May. He bore with him a letter from Barron to Rodgers, resigning to the latter the command of the American forces in the Mediterranean, a station which, as he said, "the languor of sickness, and consequent mental as well as bodily inactivity, prevented him from filling any longer, with approbation to himself, or with advantage to the service." Some remarks are here necessary.

Commodore Barron had arrived in the Mediterranean, affected with a disease which universally weakens the mental powers of those who are subject to it; in his case we have the evidence of his officers, that during the whole winter and spring, he had been "disqualified from transacting any business, his mind being so mach impaired, that he scarcely recollected what transpired from one day to another; and on applications being made to him for instructions, he would lose the recollection of what passed in the course of conversation." It was also generally believed by the officers in the Mediterranean, "that Mr. Lear had a great ascendancy over the Commodore in all his measures relative to the squadron." For merely exercising such an ascendancy, Mr. Lear cannot certainly be blamed; nor can it be imputed as a fault to Barron, that in his situation it should have existed; he had been intrusted with an important command, which he wished to retain, particularly as he was much better acquainted with the views and wishes of his government, than the officer who would succeed him in case of his resignation could possibly have been. Under these circumstances it was natural, that being himself aware of his debilitated state, he should have looked for counsel and assistance to one in whom their government had manifested such implicit confidence. Respecting the course to be pursued with Tripoli, Mr. Lear in all his despatches and recorded conversations, had advocated the propriety of strong measures, for which he considered the forces of the United States alone as perfectly adequate. To the plan of co-operation with Hamet, he had been from the first opposed, pronouncing it visionary and impracticable; he insisted that Yusuf might be compelled to accede to honorable terms without any extraneous assistance whatever, and "that more reliance might be placed on a peace with him if well beaten into it, than with his brother, if placed on the throne by the aid of the Americans." When the accounts arrived of Eaton's junction with Hamet, and their projected expedition from Egypt, he declared his conviction openly that it would prove fruitless, and "that they with their adherents, would be sacrificed before reaching Derne." For these opinions there were certainly strong grounds; but knowing as he did, that Yusuf had manifested the utmost uneasiness ever since he had been informed of his brother's intended expedition, how could Mr. Lear have supposed that no impression favorable to the United States had been made on him, by the capture of Derne and the defeat of his army? We have certainly a right here to suspect the existence of prejudice or of personal feeling, or of too great a disinclination to acknowledge the erroneousness of previous assertions. That "a deep impression had in reality been made on the Pasha by the heroic bravery of the few Americans at Derne, and by the idea that the United States had a large force and immense supplies at that place," he indeed afterwards admitted, and endeavored from thence to make an arrangement favorable to Hamet. From the terms of Rodgers's letter already quoted, it appears that he was by no means desirous to negotiate until the Pasha should have been humbled; and he declares in another letter, that he never had entertained any apprehensions for the lives of the prisoners. It is therefore possible, that had not Barron before his relinquishment, taken such decided steps with regard to the abandonment of Hamet's cause, and (at least apparently) induced Mr. Lear to enter upon the negotiation with Yusuf, those measures might have met with some opposition from Rodgers, which delicacy under the actual circumstances forbade.

The Spanish Consul boarded the Essex immediately on her arrival off Tripoli; Mr. Lear informed him that he had come at the Pasha's request to treat for peace, but that the terms which had been already proposed through him were inadmissible, and that unless they were put aside entirely, no progress could be made in the affair. The Consul returned to Tripoli, and came on board again on the 29th, bringing a commission from the Pasha to treat on the principal points of accommodation; Yusuf relinquished all demands of payment for peace, and offered to restore the prisoners for a hundred and thirty thousand dollars, the Tripolines in the hands of the Americans being given up gratis. Mr. Lear replied by other propositions, which were—that the prisoners should be restored on both sides, the Americans immediately, the Tripolines as soon as they could be brought from America and Sicily where they then were; that as the Americans exceeded the Tripolines in number by about two hundred, the sum of sixty thousand dollars would be paid as ransom for the balance in favor of the Pasha; and that a treaty of peace should then be made on mutually honorable and beneficial terms. After some difficulties, Yusuf agreed to these propositions, except that he refused to give up his prisoners until the Tripolines were ready to be delivered to him in return for them.

This was probably only a pretence to gain time. Indeed, within the preceding year, the question between the United States and Tripoli had been materially changed. The Americans had appeared in such force in the Mediterranean, that they could no longer be regarded as supplicants for peace, and the great object was to obtain the liberation of their captive fellow-citizens; on the other hand, the Pasha had suffered so much from the blockade and the expenses of the war, that he was desirous to have it terminated on as good terms as he could obtain. Hamet's success at Derne had much increased his anxiety, and knowing that it was entirely due to the assistance of the Americans, he was determined not to give up the advantages he possessed by means of the prisoners, without securing in return the withdrawal of this important aid from his brother's cause; for this reason he wished to have the treaty of peace made before the execution of any other measures. As to the restoration of his own subjects who were in the hands of the Americans, he was entirely indifferent; often declaring when exchange was proposed, "that he would not give an orange apiece for them."

On the 1st of June, Bainbridge came on board, under guaranty of Mahomet D'Ghies and the Danish Consul. He assured Mr. Lear that Yusuf would not consent to surrender the prisoners, until a treaty of peace were made. As the objects of the Americans were to obtain the liberation of their countrymen and security for their commerce and navigation in future, it was not worth while to oppose this, and Bainbridge was directed to inform the Pasha, that if the terms proposed were accepted, a negotiation would be immediately entered into for a treaty, with any proper person duly authorized by him, but that no farther communication would be held with the Spanish Consul. Yusuf upon this accordingly commissioned Mr. Nissen to confer with Mr. Lear on the terms of the treaty; instructing him specially to have an article inserted, stipulating that the American forces should be withdrawn from Derne, and that efforts would be used to persuade Hamet to leave the Tripoline dominions. This stipulation was agreed to by Mr. Lear, who, however insisted that the Prince's family, who still remained in the Pasha's hands, should be restored to him. Yusuf objected and the negotiation was almost at a stand; at this crisis the Nautilus arrived from Malta, bringing notices of Eaton's farther successes at Derne, and also information of the arrival of additional forces from the United States. Rodgers here expressed his anxiety to try the effect of farther offensive operations against him; but Mr. Lear "would not suffer the business to be broken off and leave his countrymen longer in slavery," and therefore consented that time should be allowed for the delivery of Hamet's family. The difficulties between him and the Pasha were then removed and the preliminaries were assented to by both parties. Mr. Lear landed directly after, and on the 4th of June 1805, corresponding with the 6th of the first month of Rabbia of the year of the Hegira 1220, a Treaty of Peace and Amity between the United States of America and the Pasha, Bey and subjects of Tripoline Barbary, was signed at Tripoli.

By this treaty, firm and inviolable peace and sincere friendship was to exist between the two nations; the prisoners were to be returned on each side, sixty thousand dollars being paid by the Americans for the difference in number against them; the forces of the United States, in hostility against the Pasha at Derne or elsewhere in his dominions, were to be withdrawn, and no supplies to be given by the Americans during the continuance of the peace, to any of his subjects who may be in rebellion against him; the Americans were to use all means in their power to persuade Hamet to retire from the Tripoline territory, but they were to use no force or improper means to that effect, and in case he should thus retire, the Pasha was to deliver up to him his wife and children. The stipulations respecting commerce and navigation, the rights of citizens and of consuls of either party in the territories of the other, the assistance to be given to stranded vessels, the protection to be afforded to vessels pursued by an enemy, &c. were placed on the most equal footing; and it was moreover declared, that in case a war should hereafter break out between the two parties, the prisoners taken on either side should not be made slaves, but should be returned at a stated ransom. This provision was at least harmless, and it held out inducements to humane conduct.

The American prisoners were sent on board the squadron, immediately after the signing of the treaty, and the Constitution frigate was sent to Malta and Syracuse for the money to be paid as ransom and the Tripolines. The American flag was again hoisted in the town, a Consul was installed, and the inhabitants testified their pleasure on the termination of a war by which they had so severely suffered.

This pacification has proved most advantageous for the Americans; no tribute has been since paid by them to Tripoli, nor has any infraction of the treaty been made either by the government, or the subjects of that regency, without full indemnification having been promptly obtained for it. The Pasha has indeed always appeared ready to do or to submit to any thing, rather than have another war with the United States. There is however every reason to suppose that the peace might have been made on terms more honorable to the Americans; and it is difficult to conceive what proper motives could have induced their commissioner, to offer a sum of money as ransom for the prisoners, with so strong a force at his disposal, and with the finest province of the Tripoline dominions actually in the hands of his countrymen. The proposition must certainly have surprised Yusuf, who had up to that moment received from him nothing but expressions of a fixed determination to seek peace only at the cannon's mouth.