Meanwhile the Sultan was again at leisure to carry into effect the long projected plan against the country. A squadron was prepared, and one Ali-ben-Zool, a notorious pirate, was placed in command, and furnished with a firman or commission as Pasha. This squadron entered the harbor of Tripoli on the night of the 29th of July, 1793, and during the confusion that ensued, the Turks having got possession of the gates, were in a short time masters of the town. The firman was then read, and the Pasha was summoned to deliver the castle to the representative of his sovereign. The poor old man was struck almost senseless with the news; his wife and family finding that resistance was impossible escaped, carrying the Pasha more dead than alive out of the city, where they at first were protected by an Arab tribe. Yusuf seeing when too late the misery which he had brought on his family, at length begged forgiveness from his father, and the Princes uniting their forces, endeavored by an assault on the town to retrieve their fortunes; but it proved unsuccessful; the Pasha's party was betrayed, and the Turkish power was for a time established. Every species of cruelty was then committed by Ali-ben-Zool, for the purpose of extorting money from the wretched inhabitants, and scenes were acted, which it would be shocking to relate. The unfortunate Lilla Halluma soon died of grief; her husband and sons retired to Tunis, where they were received and generously assisted by the Bey.

The Porte at length was induced by the cruelties of its agent, to withdraw its support, and leave was given to the Caramalli family to regain their dominions. Ten thousand troops accordingly marched from Tunis in the spring of 1795, under the command of Hamet and Yusuf; ere they reached Tripoli, Ali-ben-Zool had evacuated the place, and retired to Egypt. This ruffian was afterwards made Governor of Alexandria in 1803, subsequently to the expulsion of the French, where he pursued the same course of cruelty and extortion as at Tripoli, until he was at length murdered by his guards.

It is not to be supposed that Yusuf took all these pains merely to establish his brother quietly in Tripoli; the rude soldiery who decide matters of that kind in Barbary, could not but see a difference between him and Hamet, which was by no means in favor of the latter. Of this disposition Yusuf took full advantage, and so ingratiated himself with the troops, that when at length the news of old Ali's death reached the city, he was unanimously proclaimed Pasha; his brother, who was absent at the time, on returning, found the gates closed against him, and received an order from the new sovereign to retire to the distant province of Derne, and remain there as Bey. Hamet having no other resource, went to his place of banishment, and remained there for some time; but finding that his brother was daily making attempts to destroy him, he at length in 1797 retired to Tunis, where he was supported by the Bey.

The earliest act of Yusuf with regard to foreign intercourse, was the conclusion of a treaty with the United States, which was signed on the 4th of November, 1796, Joel Barlow then American Consul at Algiers and Colonel David Humphries, being the agents of the latter party. Its terms are generally reciprocal; passports are to be given to vessels of each country by which they are to be known—"As the Government of the United States is not in any sense founded on the christian religion, and has in itself no character of enmity against the laws, religion or tranquillity of Mussulmen, no pretext arising from religious opinions shall ever produce an interruption of the harmony between the two countries"—the Pasha acknowledges the receipt of money and presents, "in consideration for this treaty of perpetual peace and friendship, and no pretence of any periodical tribute or farther payment is ever to be made by either party." Finally, the observance of the treaty is "guarantied by the most potent Dey and Regency of Algiers, and in case of dispute, no appeal shall be made to arms, but an amicable reference shall be made to the mutual friend of both parties, the Dey of Algiers, the parties hereby engaging to abide by his decision."

To the terms of this treaty it would be difficult to offer any objection; the United States were anxious that their commerce in the Mediterranean should be undisturbed; their naval force was inadequate to its protection, and it was then considered inexpedient to increase that force. Presents were given in compliance with a custom generally if not always observed, and it was certainly the more manly course to have the fact openly stated in the treaty, with the proviso annexed, that none others were to be expected. The treaty between the United States and Algiers was on terms less equal, as it contained a stipulation on the part of the former to pay an annual value of twenty-one thousand dollars in military stores.

Thus secured from interruption, the American commerce in the Mediterranean rapidly increased, and the Tripoline corsairs were daily tantalized by the sight of large vessels laden with valuable cargoes, which were to be passed untouched, for no other reason than because they sailed under the striped flag and carried a piece of parchment covered with unintelligible characters. This must have been the more vexatious to the corsairs as they never met with ships of war belonging to the nation which they were thus required to respect.

Reports of this nature did not fail to produce their effect upon Yusuf; his cupidity was excited, and he doubtless feared that his popularity might suffer, if his subjects were longer prevented from pursuing what had always been considered a lawful and honorable calling in Barbary. He had collected a small maritime force, estimated in 1800 at eleven vessels of various sizes, mounting one hundred and three guns, and thus considered himself strong enough to give up the further observance of a treaty with a power which appeared so incapable of enforcing it. In this idea he was encouraged by his naval officers. The chief of these was a Scotch renegade, who had been tempted to exchange the kirk for the mosque, and his homely name of Peter Lyle, with his humble employment of mate to a trading vessel, for the more sounding title of Morat Rais, and the substantial appointment of High Admiral of Tripoli. Rais Peter is represented by all who knew him as destitute of real talent, but possessing in its stead much of that pliability of disposition which is supposed to form an essential characteristic of his countrymen; however that may have been, he for some time enjoyed great credit with the Pasha, and employed it as far as he could against the interests of the United States. Whether this arose from any particular enmity, or from the hope of enjoying a share of the anticipated spoil, is uncertain; but to his influence was mainly ascribed the proceedings which led to a rupture of the peace. Another abettor of the war was the Vice Admiral Rais Amor Shelly, a desperate ruffian, who was most anxious to be engaged where there was such evident promise of gain. Hamet Rais, the minister of marine, was of the same opinion, and probably of all his councillors, Yusuf placed the greatest confidence in him; he is represented as a man of great sagacity and energy—such indeed, that Lord Nelson thought proper in 1798, to send a ship of the line, with a most overbearing letter, demanding his exile, which the Pasha promised, but after the departure of the ship thought no more about it. The only friend of the United States in the regency, was the Prime Minister Mahomet d'Ghies, whom every account represents as an honorable and enlightened gentleman.

Thus fortified by the assurances of his counsellors, and farther induced by his success in bringing Sweden to his terms, Yusuf commenced his proceedings against the United States in 1799, by making requisitions of their consul; these were resisted, and to a proposal from Mr. Cathcart (the consul) that reference should be made to the Dey of Algiers, as provided in such cases by the treaty, the Pasha replied that he no longer regarded the stipulations of that convention. His intentions became more clearly defined in the ensuing year, when Rais Shelly returned from a cruise, with an American brig, which he had brought in under pretence of irregularity in her papers; she was indeed restored, but not until after long delay and the commission of numberless acts of petty extortion, accompanied by hints that such lenity would not be again displayed. Considerable time having elapsed without any answer from the United States, the consul was informed that the treaty with his country was at an end; that the Pasha demanded two hundred and fifty thousand dollars as the price of a new one; and that it must contain an engagement on the part of the United States, to pay an annual tribute of twenty-five thousand dollars for its continuance. No reply having been made to this, war was formally declared by Tripoli on the 11th of May, 1801, the American flag staff was cut down by the Pasha's orders on the 14th, and Mr. Cathcart left the place a few days after.

A swarm of cruisers instantly issued from the port of Tripoli, and spread themselves over every part of the Mediterranean; two of them under Morat Rais arrived at Gibraltar, with the intention of even braving the perils of the unknown Atlantic, in search of American vessels. In the course of a few weeks five prizes were taken by the corsairs; but the consul of the United States had long foreseen the danger, and given timely warning, so that interruption of their commerce was almost the only evil afterwards suffered.

As soon as the news of these exactions arrived in Washington, President Jefferson caused a squadron, composed of three frigates and a sloop of war, to be fitted out and despatched to the Mediterranean, under Commodore Dale; it entered that sea about the end of June, 1801, and was probably the first American armed force seen in its waters. This squadron was sent with the hope that its display would be alone sufficient to bring the Pasha back to the observance of the treaty; the Commodore was therefore instructed to act with great caution, so as to repress rather than provoke hostilities; and he was made the bearer of letters to each of the Barbary sovereigns, couched in the most amicable terms and disclaiming all warlike intentions. The squadron touched first at Tunis, where its appearance somewhat softened the Bey, who had begun the same system of exactions from the American consul; it then sailed for Tripoli, before which it appeared on the 24th of July.