
The saga around the Strait of Hormuz brings to mind that the entire Mediterranean Sea was once controlled by the Muslim rulers of North Africa. European states paid them tribute for free trade. And only young independent America accepted the military challenge.
In September 1785, the US ambassador to France, Thomas Jefferson, received a letter from Algeria.
We, subjects of the United States of America, having the misfortune of being captured by Algerian pirates off the coast of Portugal on the 24th and 30th of July, were brought to this port, where we were enslaved and sent to workhouses. Our suffering defies either description on our part or comprehension on yours. We hope that Your Honor will deign to bring our complaints to Congress. We hope that Congress will take steps to facilitate our speedy redemption. We hope that you will take into account our plight and provide some support to us unfortunate sufferers until we are ransomed; for we are deprived of all clothing and have no means of subsistence, receiving only two small loaves of bread a day - and nothing more than the necessities of life.
The author of the letter was the captain of the American merchant ship "Dauphine" Richard O'Brien. The US Ambassador to England, John Adams, received a similar message .
Turkey's vassal states in northern Africa - however, they were not only nominal vassals - made piracy in the Mediterranean Sea their main trade. The European powers, preoccupied with wars with revolutionary France, did not have the resources to fight the pirates and preferred to pay tribute to the Barbary Coast, as these countries were collectively called. Having won independence, the United States replaced the British flag on its ships with an American one and lost the protection of the British fleet. In October 1784, Moroccan pirates captured the American brigantine Betsy.
For the United States, the security of trade with Europe was a matter of paramount importance. In March 1785, Secretary of State John Jay notified Jefferson, Adams, and Franklin, who were in Europe on a diplomatic mission, that Congress was directing them to conclude treaties with Morocco, Algeria, Tunisia, and Tripolitania and that they were “authorized to use for these purposes, to such extent as they may deem necessary, but not exceeding eighty thousand dollars, a portion of the funds borrowed from Holland, or any other funds located in Europe and belonging to the United States."
The ambassadors began to find out what amounts could be discussed. Thanks to their sources in the Netherlands, they learned that The Hague annually supplies the Barbary states with ship gear, cannons and gunpowder worth from 50 to 60 thousand florins, and also sends their rulers and ambassadors rich gifts: watches inlaid with precious stones, porcelain, fabrics and much more.
Jefferson believed that the problem should be solved by military force
Adams and Jefferson had opposing views on the issue. Jefferson believed that it should be solved by military force.
Our trade with Portugal, Spain and the Mediterranean countries will be completely destroyed unless we take some decisive action. Tribute or war is the usual alternative offered by these pirates. If we agree to the first, it will require such sums of money that will become a tangible burden for our people. Why then not start creating a navy and make a choice in favor of war?
So he wrote from Paris to General Horatio Gates back in December 1784.
Adams believed that it was more profitable to pay than to fight. He calculated that "for an annual interest of £30,000 (or perhaps as little as £15,000 or £10,000) we could obtain peace, whereas war would cost us ten times as much annually." Jefferson objected to him: "...Personally, I would prefer to achieve peace by military means. 1. Justice is on the side of this opinion. 2. Honor also demands this. 3. This will ensure us respect in Europe, and respect serves as a reliable defense of our interests." He believed that investing in a navy was smarter than paying off pirates year after year.
He even developed a draft anti-piracy convention, which, according to his assumptions, the Kingdom of Naples, Portugal, the Venetian Republic and other European powers were supposed to join. But the powers reacted to the project without enthusiasm.
Be that as it may, Congress decided in favor of negotiations, and it should have been carried out. In 1777, Morocco became the first country in the world to recognize the independence of the United States. In response, Congress promised to send its own negotiator, but it seems to have forgotten about its promise. By seizing the ship Betsy, the Sultan of Morocco, Sidi Mohammed bin Abdallah, reminded the Americans of their promise in a unique manner. He forbade his subjects to seize other American ships, and announced to the Betsy crew that they were not slaves, but prisoners. Nine months later, without waiting for the American envoy, he handed them over to the Spaniards. He wanted to return the ship, but it turned out to be unseaworthy and was lost along with most of the cargo.
In June 1786, US authorized representative Thomas Barclay finally reached Morocco along with a draft treaty of peace and friendship and 20 thousand dollars for gifts to the Sultan and his entourage. “We urge you to make every possible effort to reduce expenses to a level as low as possible in comparison with this amount,” Adams and Jefferson wrote in instructions to Barclay (Franklin had already returned to America by this time). After two audiences with the Sultan, the document, with minor amendments, was signed in Marrakesh in January 1787. The tribute amounted to 5,000 pounds sterling at the conclusion of the treaty and the same amount when it was renewed in 1795, not counting generous gifts, cannons, gunpowder and small arms.

The most serious threat remained Algeria, which, according to Jefferson, had 16 warships. Not to mention his financial strength - his treasury was estimated at 20 or 30 million dollars, while the United States was on the verge of bankruptcy. The basis of Algeria's prosperity, in addition to pirate fishing, was the export of wheat to Europe. The head of state was a dey elected by the Divan, who consisted of commanders of the Janissary Guard (aga) and pirate captains (rais). Previously, the Sultan sent his governor, the pasha, but by the beginning of the 18th century the pashas had lost their influence, and the last of them was expelled from the country in 1711. However, the dey himself was dependent on the Janissaries, who removed and even killed deys they disliked.
Only vile opinions about the barbarians were ingrained in Europeans because of a lack of fair news
In 1776, captain-lieutenant of the Russian fleet Matvey Kokovtsov was sent to Tunisia and Algeria to familiarize himself with the ports of these countries. He subsequently revised his reports to the Admiralty into the book “Reliable News about Algeria.” Thanks to her, we can look at the situation there through the eyes of an unbiased observer. Kokovtsov complains about the distorted image of local morals and the way of government:

Everywhere the barbarians are revered as a people who are hard-hearted, inhuman, lawless and superior in wickedness to the wildest American inhabitants. It is only the vile opinions about the barbarians that have taken root in Europeans because of a lack of fair news... It is true that the unlimited freedom and malice of the Turkish Janissaries in Barbary is the cause of many abuses and insolence, and especially during times of change, which often happen there; but as soon as these changes pass, the government turns to concern for justice and general peace.
Like any foreigner, Kokovtsov paid a visit to the dey:
Foreigners arriving in Algeria after 24 hours introduce themselves to Dey, whose hand they kiss as usual... Moreover, Dey asks them in Franco (that is, the lingua franca - the language of business communication in the Mediterranean, a mixture of Arabic, Spanish, Turkish, Italian and Provençal - V.A.), “where did they come from and why and how long will they stay in his area?” After which they can take a Janissary as their support, for their safety in the city of their stay.
It is possible that one of the American prisoners was present at this audience, about whom we will talk below. The pastime of local residents, according to Kokovtsov, is quite monotonous:
There are no public gaiety events in Algeria; the locals spend most of their time in coffee houses and smoking tobacco; they treat no one else except their wives, concubines and slaves. They usually play chess, and even then always without money, and other unprofitable games are very strictly prohibited among them.
On July 25, 1785, three miles from the Portuguese Cape St. Vincent, Algerian pirates attacked the American schooner Maria, and on August 4, two hundred nautical miles southwest of Lisbon, they attacked the Dauphine. First of all, the sailors were robbed while still on the ship: their clothes, hats and shoes were taken off and they were given lousy rags in return. In this form they were paraded around the city and put on display at the market for the amusement of the public. A crowd gathered to stare at the Americans. She expected to see Indians in feathers and was disappointed to see ordinary European captives. A few days later, the sailors were shown to Dey Muhammad V bin Osman. He selected some of the prisoners to serve in his palace (they were given beautiful clothes in the Turkish style), and sent the rest to hard work. He sent the captains into service in the house of the British consul. Subsequently, the Spanish diplomat Count d'Espily, who arrived in Algeria for peace negotiations, at the request of the US Charge d'Affaires in Madrid, William Carmichel, rented a house for the captains and provided them with money for food. Those who were selected to the palace worked in the palace kitchen and stables and slept there. Those assigned to hard labor were placed in slave prisons infested with rats and insects. The American government allocated seven and a half cents a day for each captive, but even this paltry money did not arrive regularly.
One of the Maria's sailors, James Cathcart, managed to attract the attention of the dey. At first, his responsibility was to care for the animals of the palace menagerie. He was severely punished several times, then he was appointed as a clerk in the prison where his compatriots were kept. He managed to borrow or save money to purchase several taverns, and with the proceeds from this enterprise he began to buy food and basic necessities for the captives. Eventually, after learning Arabic and Turkish, he became the dey's personal secretary.

When reading Cathcart's notes , one does not get the impression that the Moors, as he calls them, showed any particular cruelty or malice towards the Americans or Europeans. This was simply the usual attitude towards slaves, they did not understand anything else and punished them - with blows of sticks on the soles of their feet, the so-called "bastonade" - often for prevention, without any guilt.
Here again it is appropriate to turn to the notes of Matvey Kokovtsov:
All the domestic servants of the Algerian Dey and other official Turks consist of slaves, whose maintenance is proportionate to the wealth and goodwill of their masters. The virgin slaves are kept better than others, they are always dressed very cleanly and, taking advantage of the generosity of this ruler or their craft, they not only earned a ransom for themselves, but also, having acquired deliberate wealth, some of them no longer even think about freeing themselves from bondage and returning to their fatherland, but remain there forever willingly.
...Other slave slaves are used for public work, such as building courts, repairing fortresses and roads; these also have not only on holidays, but also on working days, enough time for rest, which they use for their benefit. Algerian policy saves Christian slaves in order to finally receive a good ransom for them.
We also have evidence from two more American prisoners. One of them, Jonathan Cowdery, the ship's surgeon of the frigate Philadelphia, which ran aground and was captured by the Tripolitans in 1803, in his diary describes the conditions of captivity as quite tolerable. As historian Paul Bepler puts it , his work "reads more like the diary of a gentleman experiencing only minor inconveniences while on vacation." Sailor William Ray, in his memoirs “The Horrors of Slavery,” argues with the doctor: the officers, according to him, were kept much better: “Therefore I ask you to remember: when the doctor says “we,” it is tantamount to saying “we are only officers,” for he does not consider it necessary to condescend to tell how the crew was provided for - whether the people were barely alive or whether they were all already dead.” One of the Philadelphia crew members, Quartermaster John Wilson, converted to Islam and put on a turban and, as Dr. Cowdery writes, betrayed a military secret to the enemies - he indicated the place of Tripolitan Bay where the crew dropped a chest of gold.
Congress simply did not have the money to pay tribute
From 1777 to 1789, the United States had a constitutional document called the Articles of Confederation and Perpetual Union, according to which Congress had no taxation powers; the main income of the federal budget came from customs duties and excise taxes. Congress simply did not have the money to pay tribute to the Barbary Coast or to ransom captured sailors. The American press published heartbreaking stories of unfortunate prisoners based on rumors. As usual in such cases, a fraudulent scheme to deceive their relatives appeared: sailors who had allegedly been in barbarian captivity came to them and offered help in freeing the sufferers. In August 1788, one such relative, Thomas Thomson, wrote to General Washington, then not yet president, about such a visitor:
The circumstance that prompted me to address Your Excellency on this matter was the very sad fate of one very worthy gentleman - Dr. William Spence. In September 1781, he left Britain with his wife and child to return to his homeland (where he had been sent as a boy to receive his education). Along with many other passengers - both American and British - they boarded the Buckskin Hero, commanded by Captain Gordon, bound for New York. The voyage proceeded safely for 30 days, and the travelers believed that Sandy Hook Point was only two or three days away; This is evidenced by a letter written by the doctor to his friends in Glasgow on October 24 and transmitted to the ship they met at sea. From that moment until April 3 last year there was no news of them, and everyone was firmly convinced that the ship had sunk at sea. However, according to the information of one James Joshua Reynolds of Philadelphia - a man only recently returned from Algerian slavery (whose story I enclose with this letter for Your Excellency's information) - it turned out that the Buckskin Hero was captured by the Algerians and confiscated as American property (and before that the ship's pass for navigation in the Mediterranean was destroyed). On board was a very valuable cargo - too great a temptation for the Algerians to resist; as a result of this, the entire crew of the ship and about 30 passengers were enslaved. In such a case and under such circumstances, dare I hope that Your Excellency will deign to intercede before the French court on behalf of this unfortunate family? I am firmly convinced that the French court - on your recommendation - will instruct its consul in Algeria to bring this matter to the attention of the Algerian Regency, which promises very encouraging prospects for the restoration of justice.
Washington promised assistance , but doubted the reliability of Reynolds' information, suspecting him of being a fraudster. And so it turned out. This was far from an isolated incident. On the other hand, charity events took place in America - the funds collected were used to support the prisoners. Shipowners also contributed.
The ambassadors in London and Paris, Adams and Jefferson, tried to do something at their own discretion and within the limits of the funds allocated to them. In March 1786, their representative, John Lamb, arrived in Algiers to negotiate a ransom. He acted on the basis of instructions that stated:
We authorize you to negotiate for the release of the crews of the said vessels, as well as any other vessels which have been or may be captured by the same Power, until the cessation of hostilities - a cessation which we expect will be achieved by your efforts; and in the intervening period you must provide these people with such necessary assistance as their situation may require. In negotiating this special treaty, you must consider yourself to be acting not only on behalf of the United States, but also on behalf of the captains of the vessels; accordingly, you may not agree to any terms that do not receive their approval. You must obtain from them written undertakings - from each captain separately in respect of his crew - in which they (the captains) and the owners of the vessels undertake to reimburse the United States for the money paid for the ransom of prisoners, their maintenance, transportation to their homeland, and other expenses incurred, - provided that the Congress deems the demand for such reimbursement justified; the special agreement you have signed should be sent to us for final approval... We do not expect to ransom our prisoners for less than $100 per person, but we are afraid to go beyond twice that amount.

Lamb met with the dey four times and soon became convinced that it was impossible to ransom the prisoners for the amount allocated by Congress. This is what he told the ambassador in Paris:
I am convinced - and based on the best information - that the amount at our disposal will in no way achieve our goal unless it is significantly increased. It is my duty to advise the abandonment of this enterprise, since it would be completely in vain to persist in it. Any expense associated with this attempt will be only a permanent loss of funds... The ransom for our people will cost at least $1,200 each; there are twenty-one of them in total... If we have to engage these people in battle, the minimum required number of our forces should be five 36-gun frigates and two large tenders.
Jefferson replied :
The sum which Algeria is likely to demand as a ransom for our prisoners, as well as as a price for peace, is so vastly beyond our capabilities and the expectations of the Congress that we have considered it our duty to leave the whole matter to their discretion. Whether they choose to buy peace, achieve it by force, or do nothing at all will depend entirely on their will.
Captain O'Brien, dejected by Lamb's failure, continued to appeal to Jefferson:
the poor fellows continue to endure all the hardships of slavery
It has been almost three months since Mr Lam left Algeria, promising to raise the money within four months. I hope - for our own sake and for the sake of the honor of his country - that he will not go back on his word to the Algerian Dey. We have received from Mr. Lamb a few lines conveyed by the Spanish brig. Mr. Lamb writes that he informed you of our situation several months ago, but received no answer either from you or from Mr. Adams; therefore he cannot say what decision will be made regarding us. In his letter he mentions that it was not in his power to ransom us, since his instructions prohibited offering more than $200 for each person. I never blamed him for not buying us out, because such an insignificant amount was allocated for these purposes, as he repeatedly told me and others. For almost a year now we have been languishing in the chains of slavery, without receiving any news from the continent; and lately - since Mr. Lam's arrival here - we have been deprived of any assurances from our country or our countrymen. Mr. Lamb's letter plunged us into the deepest grief; our gloomy, miserable situation oppresses us more than we can express in words or than you can imagine. We try to console our unfortunate sailors, but the poor fellows continue to endure all the hardships of slavery.
Upon learning of the outbreak of bubonic plague in Algeria, Jefferson turned to the monastic Order of the Mathurins, also known as Trinitarians, for help. Named after an early Christian French saint, the order was founded in the 12th century specifically to ransom Christians from Muslim captivity. If the captives could not be redeemed, the monks offered themselves instead. In January 1787, Jefferson met with the head of the Order of the Saint in Paris, Father François Maurice Pichot. After talking with him, he wrote to Adams in London:

There is an order of priests here called the Mathurins; their goal is to collect alms for the ransom of captives. About eighteen months ago they ransomed 300 people, costing them about 1,500 livres each. They have agents permanently residing in the states of the Barbary Coast; these agents are constantly engaged in searching for and making ransom deals for the captives of their nation, and they manage to ransom them at a lower price than anyone else.
Adams advised him to abandon this idea. But Jefferson still sent his proposal to Secretary of State Jay. Jay submitted Jefferson's plan to Congress, accompanied by a petition from Hannah Stevens, the wife of one of the captives, Captain Isaac Stevens. Congress allocated the requested amount, but ultimately nothing came of this initiative. And soon the order was subjected to brutal repression by the revolutionaries, and Jefferson lost contact with it.
In July 1790, when Jefferson was already Secretary of State, O'Brien sent him a "price list" - the ransom amount for which the Algerian dey agreed to release the prisoners. This amount amounted to 17,225 sequins. The price of each hostage was also mentioned in the message. For O'Brien himself they demanded 4,000 sequins, for the sailor - 700. (A sechin, also known as a Venetian ducat, is a gold coin weighing 3.5 grams; converted into the North American dollar at the rate of 2-2.3 dollars per sequin).
O'Brien wrote to Jefferson:
After the Spaniards, Neapolitans and representatives of other nations ransomed their compatriots, and the plague epidemic of 1787-1788 claimed the lives of 780 slaves (among whom were six Americans), the total number of slaves was reduced to 700 people... Since then, the dey has increased the price of slaves and is extremely reluctant to agree to their ransom, since slaves are urgently needed for public works - I assure you, sir, very debilitating. The price asked for the Americans is by no means excessive, considering the present shortage of slaves, as well as the conditions for the release of captives belonging to other nations.
Indeed, sir, for the sake of the honor and interests of the United States of America, I sincerely hope that the price now set for our liberation will be immediately accepted. And rest assured, sir: if we miss this opportunity, we will become the most unfortunate slaves in the world, for we will be doomed to eternal slavery.
In July 1794, the US Ambassador to Portugal, David Humphreys, received a dispatch from Edmund Randolph, who had succeeded Jefferson as Secretary of State. By this time, Algerian pirates had already captured 13 American ships, the number of prisoners was 119 people. O'Brien, on their behalf, sent petitions to both houses of Congress, mentioning, among other troubles, the bubonic plague epidemic, from which 11 Americans had already died. Their relatives managed to ransom four people. The Secretary of State conveyed to the Ambassador instructions from President Washington to go to Algeria:
Ransom and peace should, if possible, go hand in hand; however, if peace cannot be achieved, the ransom must be carried out without delay. By trying to negotiate the ransom at the lowest possible rate - or at the rate accepted in Portugal and other countries enjoying the least privilege - you can, if necessary, increase the amount up to three thousand dollars per person.
Humphreys had to agree on acceptable peace terms, which Randolph considered an annual tribute of 50 thousand dollars and a one-time contribution of 200 thousand, “if this will ensure peace for an acceptable period.” Humphries was supposed to borrow money, $800 thousand, from the Amsterdam banking house Willink & Co under guarantees of the US government.
Meanwhile, in Algeria, the prisoners, represented by their representatives O'Brien and Cathcart, tried to independently negotiate the price of their release. O'Brien Dey - this was already the successor of the former, Baba Hassan III - stated that he was ready to sign peace and release them for 2 million 435 thousand Mexican dollars (the Mexican dollar was equal to the American one), including gifts to the Dey, his associates, officials and servants, including senior cooks, head groom and gatekeeper. This doesn't include the $30,000 annual fee. For each captive the dey wanted to receive $3,540. He later quoted a higher price to Cathcart—$6,000 for the captain, 4,000 for his secretary and three of his servants, and 3,000 for everyone else. Together with the peace treaty, this amounted to 2 million 247 thousand dollars plus 12 thousand Algerian sequins ($21,600) annual tribute. All US budget revenues in 1794 amounted to 5 million 482 thousand dollars with a deficit of one and a half million.
Having received such news, Humphreys went to America instead of Algeria. In Philadelphia (then capital), he met with Randolph and other administration officials and visited George Washington at his Mount Vernon estate. He was accompanied everywhere by Philip Sloan, a sailor who was ransomed by the Dutch government along with the Dutch at the conclusion of a peace treaty with the Dey in April 1794. Sloan rose to the position of senior sweeper of the palace. It was decided to ask France for assistance. Humphreys' ambassador in Paris, James Madison, and Joel Barlow, a poet and publisher who lived in Paris and took an active part in the French Revolution (he was even elected to the National Assembly and received French citizenship), and also Humphreys' classmate at Yale, were supposed to help Humphreys in this. Humphreys's deputy in his Algerian mission was Joseph Donaldson Jr., who had never done anything like this before. But it was he who was ultimately destined to sign the peace treaty. Before their departure, it became known that the Amsterdam bankers had refused the loan.

In Gibraltar, the diplomats were divided: Humphreys went to Paris, and Donaldson, accompanied by Sloane, who acted as translator, went to the Spanish port of Alicante, but hesitated for a long time. Donaldson and Sloan arrived in Algeria only in September 1795. Donaldson, 50, suffered from gout and could not walk without crutches. Cathcart describes him as a man of "repulsive appearance and unusually gloomy." Donaldson's unkempt appearance and rude manner offended the Algerians and caused some to question his suitability for the mission.
Before receiving Donaldson, the dey called his secretary and inquired whether the American envoy was ready to accept his conditions. Cathcart answered in the negative. Leaving the chambers, he routinely bent down to kiss the dey’s hand, but slipped on the marble floor and fell. "Can't you stand on your feet?" – the dey frowned. “I am standing,” replied Cathcart, “but the weight of your Majesty’s proposal has made me stumble.” The answer amused the dey. After talking with Donaldson, Cathcart returned and named the amount that the Americans were willing to pay - 543 thousand. “Get out of my sight, you soulless dog,” the dey became angry. Donaldson's stubbornness angered him. He ordered him to leave Algeria. Then Cathcart told the dey that if he did not accept America's terms, America would never negotiate again and would fight the pirates. Then he decided to put pressure on pity and began to beg to release the captives: “We have been here for 10 years... Let us go in the name of the love of God.” Dey thought for a moment, fell, as Cathcart put it, into a trance and after a few minutes said: “Go to your ambassador and tell him that I agree.”
However, soon after this scene, the dey learned from Jewish bankers living in Algeria that David Humphreys had received a loan of $800,000 from the London banking house Baring. He decided to get as much as possible. As a result, the final amount was more than 700 thousand dollars. On September 5, 1795, in Algiers, dey Baba Hassan and US Commissioner Joseph Donaldson Jr. signed a treaty of peace and friendship.
But the money had yet to be delivered. Until they were received, the dey, as a gesture of goodwill, allowed the prisoners not to be used for hard work and released O'Brien to Lisbon with the news that the treaty had been signed. Donaldson said that he was absolutely indifferent whether the prisoners worked. Dissatisfied sailors came to the house where the ambassador was staying. He tried to calm them down, but they showed up the next day. Then Donaldson called for help from the Turkish guards, who drove the sailors to work with sticks and shackled them, but Cathcart intervened and the chains were removed.
O'Brien arrived in Lisbon on September 11 and learned from Humphreys that the money could not be transferred or delivered: England was short of funds due to the war with France (this was the War of the First Anti-French Coalition, which began in 1793). Humphreys sent O'Brien to London, where, due to stormy weather, he did not arrive until January 10, and only to find that the loan was impossible.
Meanwhile, Baba Hassan began to become impatient. When signing the contract, Donaldson promised him that the money would arrive within three months. In January, the dey ordered Donaldson to hire a ship and send Sloane on it to Alicante (and not alone, but accompanied by 12 Algerians). Sloan brought Humphreys an angry letter from the dey. Cathcart urged Donaldson to send the dey an expensive gift and explain to him that the money was delayed due to the war in Europe, but he refused to do so. When Sloan returned with disappointing news, Baba Hasan became furious. He informed Donaldson that if the money did not arrive within a month, he would denounce the agreement and drive him away, and also order his secretary to be beheaded. Donaldson was not at all bothered by this, and he joked about this with Cathcart: they say that it would be difficult to cut off both of their heads, because they both had short necks.

On March 4, Joel Barlow arrived in Algeria. In Paris, he and Ambassador Monroe failed to enlist the help of France, but he bought gifts for the dey there for 27 thousand dollars. Having learned that Barlow did not bring money, Baba Hassan again became very angry. But then Sloan returned from Portugal - he brought a letter from Humphreys. The ambassador informed the dey that the American consul in Alicante had managed to obtain a loan from the Spanish government. When Sloan and Cathcart delivered the letter to the dey's palace, the first thing he did was ask them if they had brought the money. Hearing a negative answer, he became more furious than ever and ordered the “unfaithful dogs” to get out. Cathcart begged the Dey to give them the opportunity to read Ambassador Humphreys' letter, but the Dey slapped him in the face, threw away the letter and kicked them out, warning that if they came to him again without money, he would execute them. When the exiles described the scene to Donaldson, he again found a reason for a joke: it was necessary to turn the other cheek, as the Holy Scriptures command.
The Spanish money also turned out to be a bluff. But help still came. Joel Barlow turned to a representative of one of the two powerful Jewish families, the Bakri and Busnash , who were called the “Kings of Algiers” , for they were the dey’s creditors and lent money to all of Europe, and were also the main suppliers of North African wheat to France. This representative agreed to provide a loan to the United States. You had to go to Livorno to get the money. Thanks to the Livorno Laws issued by the Grand Duke of Tuscany Ferdinand I de' Medici in the 16th century, this city became a prosperous Jewish center of Europe, where Sephardim from Spain and Portugal who fled from the Inquisition moved. The Bakri trading house had a banking office there. In April Barlow sent Donaldson to Livorno.
Hope seemed illusory to the prisoners, and they became increasingly despondent. Bakri persuaded the dey to let Cathcart go to America so that he could meet with the president and convince him to send new gifts to the dey. Baba Hassan reluctantly allowed Cathcart to leave Algiers, where he had spent almost 11 years as a slave. He arrived in Lisbon on June 27, 1796.
On the same day, French troops under the command of General Murat occupied Livorno during Napoleon's Italian campaign, confiscated English, Austrian and Russian goods in the port and imposed an indemnity of five million lire on the city. At that very moment, Donaldson, having received a loan from Solomon Bakri, bought one hundred thousand dollars worth of gold bullion. The Bakri chartered a Venetian ship, and Donaldson managed to contact Captain Horatio Nelson, whose squadron was stationed in the Livorno roadstead. Nelson agreed to let the ship through. However, he was detained by the French.

O'Brien failed to raise money in Lisbon, London, or Hamburg. Having suffered a third failure, he headed to Philadelphia, where he met with Secretary of State Timothy Pickering. In March, the Senate ratified the treaty with Algeria, signed by Donaldson. Правительство США наняло О'Брайена капитаном судна "София" с жалованием 200 долларов в месяц, что было вдвое больше, чем оклад Дональдсона. О'Брайен на "Софии" отправился в Лиссабон, где совещался с Хамфрисом и Кэткартом. Там они узнали, что Дональдсон в Ливорно получил кредит на 400 тысяч долларов. Еще 200 тысяч Хамфрис достал в Лиссабоне. На эти деньги он купил золотые слитки и отправил их с О'Брайеном в Алжир. "София" вышла из Лиссабона 2 августа. О'Брайен не знал, что в этот момент узники были уже на свободе.
Пока американцы искали деньги, в Алжир прибыл новый французский консул Луи-Александр д'Аллу д'Эркюлиз. Он преподнес дею очень дорогой подарок. А потом с легкостью необыкновенной проделал следующую финансовую операцию. Он занял из казны 200 тысяч долларов без ведома дея. Эти деньги он депонировал в банкирском доме Бакри, а Бакри в свою очередь предложил заем Джоэлу Барлоу на выкуп узников.
Барлоу нанял судно, и 12 июля оно покинуло Алжир со 137 пассажирами на борту. В их числе было 84 американца (остальные или умерли от чумы, или были выкуплены ранее) и 48 подданных неаполитанского короля, выкупленных своим правительством. Один из освобожденных пленников полностью ослеп, другой почти потерял зрение, несколько человек остались инвлидами. Одного американца пришлось оставить в Алжире, так он был при смерти (он умер на следующий день после отплытия). 20 июля освобожденные моряки прибыли в Марсель, где они провели 80 дней в карантине, получая на пропитание от американского консула 35 центов в день. Он же снабдил их приличной одеждой.
14 граждан США изъявили желание поступить матросами на американское торговое судно, курсирующее в Средиземном море. 10 не прошли карантин и были задержаны в Марселе. Остальные 65 человек 12 ноября отправились в Филадельфию, однако из-за обледенения реки Делавэр им пришлось ждать еще три месяца, пока лед растает, чтобы бросить якорь в порту столицы. Жители Филадельфии доставили бывших узников в город в своих экипажах. Там все они отправились в таверну "Индейская королева". На улицах царило большое оживление.
узников выкупили, но за договор не заплатили
Улицы были настолько переполнены, что передвигаться по ним было затруднительно... Те, у кого в городе нашлись друзья, готовые приютить их, удалились, чтобы принять поздравления; однако, по свидетельствам некоторых пленников, те, кому не так повезло с пристанищем, оказались совершенно обездоленными и были вынуждены скитаться по городским улицам – в это суровое время года, без друзей и без единого цента на пропитание.
Так описывает финал этой одиссеи один из них, Эйч Джи Барнби, в книге "Пленники Алжира. Свидетельство забытого американца".
Узников выкупили, но за договор не заплатили. Баба Хасан вдруг понял, что, кроме Барлоу, у него не осталось ни одного американца, которым можно было бы шантажировать США. А уж когда он узнал, что деньги на выкуп заимствованы из его собственной казны, он рассвирепел до предела.
О'Брайен так и не довез до Алжира золотые слитки на ту самую сумму, какую одолжил у дея французский консул: его судно захватили триполитанские пираты. Кораблем, захватившим золото, командовал шотландец Питер Лайл , бывший капитан "Бетси", обратившийся в ислам и женившийся на дочери триполитанского паши, который присвоил ему звание "великого адмирала". Но когда корабль с добычей и захваченным судном пришел в Триполи, паша Юсеф Караманли рассудил, что ему не след ссориться с алжирским деем и решил вернуть судно, команду и золото.
Баба Хасан был вне себя от радости. Пожимая руку Барлоу, он говорил: "Друг мой, ты тяжко пострадал из-за немыслимой задержки этих денег... Твой народ отважен и благороден. Пока я жив, я буду вашим другом... Если есть что-нибудь, что я могу для тебя сделать – говори". Барлоу решил не упускать момент и попросил его помочь заключению мирных договоров с Тунисом и Триполитанией. Дей охотно согласился и написал паше и тунисскому бею Хаммуде. Мало того: он предложил Барлоу взаймы денег на договоры с ними. "Что же касается бея Туниса... если он не пришлет мне немедленно — на твоем корабле – мирный договор... я отправлю шестьдесят тысяч человек, чтобы отрубить бею голову", – добавил Баба Хасан. Барлоу положительно растерялся от этих слов.
4 ноября 1796 года Джоэл Барлоу подписал в Триполи договор с Триполитанией. О'Брайен получил расписку, что он доставил триполитанской стороне 40 тысяч испанских долларов, а также драгоценные дары, что в сумме составило 58 тысяч долларов США. Филадельфия обязалась также в 1799 году уплатить 18 тысяч долларов. 28 августа 1797 года французский коммерсант Жозеф Этьен Фамэн по поручению Барлоу от имени США заключил мирный договор с Тунисом. Размер дани составил 107 тысяч долларов за два года плюс корабельные снасти, порох и подарки паше и его вельможам.
Годы, проведенные в алжирском плену, оставили неизгладимый след в душах Кэткарта и О'Брайена. Оба вернулись на Варварийский берег. Кэткарт стал консулом в Тунисе и Триполи, О'Брайен – в Алжире.

В феврале 1801 года Томас Джефферсон был избран президентом США. В день инаугурации триполитанский паша Юсуф Караманли потребовал от Соединенных Штатов подарков на 225 тысяч долларов. По обычаю, при смене консула или президента следовало поднести паше дары золотом или товарами. Джефферсон с превеликим удовольствием отклонил требование. 10 мая Караманли объявил войну Америке в традиционной для Варварийского берега манере: приказал срубить флагшток с государственным флагом США перед зданием консульства. Джефферсон в ответ направил в Средиземное море военную эскадру. Началась Первая Варварийская война, за которой последовала и Вторая.
Америка отстояла свободу судоходства для себя. Всего в плену у «варваров» побывало около 700 американцев. 28 человек умерли в неволе. Судьба 39 не известна.
Окончательно проблема пиратства в Средиземноморье была закрыта после захвата Алжира Францией в 1830 году.
From sailors to slaves. Americans captured by sea robbers