|Second Barbary War|
|Part of the Barbary Wars|
Decatur's squadron off Algiers
|United States||Regency of Algiers|
|Commanders and leaders|
James Madison |
Omar Agha |
Raïs Hamidou †
3 frigates |
5 frigates |
7 smaller warships
|Casualties and losses|
|40 killed and wounded||
53 killed |
2 ships captured
1 ship sunk
The Second Barbary War (1815) or the U.S.–Algerian War was fought between the United States and the North African Barbary Coast states of Tripoli, Tunis, and Algiers. The war ended when the United States Senate ratified Commodore Stephen Decatur's Algerian treaty on 5 December 1815. However, Dey Omar Agha of Algeria repudiated the US treaty, refused to accept the terms of peace that had been ratified by the Congress of Vienna, and threatened the lives of all Christian inhabitants of Algiers. William Shaler was the US commissioner in Algiers who had negotiated alongside Decatur, but he fled aboard British vessels during the 1816 bombardment of Algiers. He negotiated a new treaty in 1816 which was not ratified by the Senate until 11 February 1822, because of an oversight.
After the end of the war, the United States and European nations stopped paying tribute to the pirate states; this marked the beginning of the end of piracy in that region, which had been rampant in the days of Ottoman domination during the 16th–18th centuries. The western nations built ever more sophisticated and expensive ships which the Barbary pirates could not match in numbers or technology.
See also: Barbary slave trade
The First Barbary War (1801–05) had led to an uneasy truce between the US and the Barbary states, but American attention turned to Britain and the War of 1812. The Barbary pirates returned to their practice of attacking American merchant vessels in the Mediterranean Sea and ransoming their crews to the United States government. At the same time, the major European powers were still involved in the Napoleonic Wars, which did not fully end until 1815.
At the conclusion of the War of 1812, however, the United States returned to the problem of Barbary piracy. On 3 March 1815, Congress authorized deployment of naval power against Algiers, and the squadron under the command of Commodore Stephen Decatur set sail on 20 May. It consisted of USS Guerriere (flagship), Constellation, Macedonia, Epervier, Ontario, Firefly, Spark, Flambeau, Torch, and Spitfire.
Following the War of 1812, Algiers sided with the British (although the British Atlantic blockade had limited US trade in the Mediterranean region). President Madison recommended that Congress declare the “existence of a state of war between the United States and the Dey and Regency of Algiers.” While Congress did not formally declare a state of war, they did pass legislation, enacted on March 3, 1815, that authorized the president to use the U.S. Navy, “as judged requisite by the President” to protect the “commerce and seamen” of the United States on the “Atlantic Ocean, the Mediterranean and adjoining seas.” Congress also authorized the president to grant the U.S. Navy the ability to seize all vessels and goods belonging to Algiers. The legislation also authorized the president to commission privateers for the same purpose. 
On 20 May 1815, a 10-ship squadron left New York (to be followed by a larger fleet under command of William Bainbridge). Shortly after departing Gibraltar en route to Algiers, Decatur's squadron encountered the Algerian flagship Meshouda and captured it in the Battle off Cape Gata. they also managed to capture the Algerian brig Estedio in the Battle off Cape Palos. On 29 June, the squadron had reached Algiers and had initiated negotiations with the Bey. The United States made persistent demands for compensation, mingled with threats of destruction, and the Dey capitulated. He signed a treaty aboard the Guerriere in the Bay of Algiers on 3 July 1815, in which Decatur agreed to return the captured Meshuda and Estedio. The Algerians returned all American captives, estimated to be about 10, in exchange for about 500 subjects of the Dey. Algeria also paid $10,000 for seized shipping. The treaty guaranteed no further tributes by the United States and granted the United States full shipping rights in the Mediterranean Sea.
Despite having successfully negotiated for their freedom, all 10 US captives perished when the ship returning them to the US, Epervier, sank in the Atlantic ocean on the 9th of August, 1815. Although the conflict was brief and small-scale, it showed US resolve and was a victory for free trade.
In early 1816, Britain undertook a diplomatic mission, backed by a small squadron of ships of the line, to Tunis, Tripoli, and Algiers to convince the Deys to stop their piracy and free European Christian slaves. The Deys of Tunis and Tripoli agreed without any resistance, but the Dey of Algiers was less cooperative, and the negotiations were stormy. The leader of the diplomatic mission, Admiral Edward Pellew, believed that he had negotiated a treaty to stop the slavery of Christians and returned to England. However, just after the treaty was signed, Algerian troops massacred 200 Corsican, Sicilian and Sardinian fishermen who had been under British protection thanks to the negotiations. This caused outrage in Britain and the rest of Europe, and Pellew's negotiations were seen as a failure.
As a result, Pellew was ordered to sea again to complete the job and punish the Algerians. He gathered a squadron of five ships of the line, reinforced by a number of frigates, later reinforced by a flotilla of six Dutch ships. On 27 August 1816, following a round of failed negotiations, the fleet delivered a punishing nine-hour bombardment of Algiers. The attack immobilized many of the Dey's corsairs and shore batteries, forcing him to accept a peace offer of the same terms that he had rejected the day before. Pellew warned that if the terms were not accepted, he would continue the action. The Dey accepted the terms, but Pellew had been bluffing since his fleet had already spent all its ammunition.
A treaty was signed on 24 September 1816. The British Consul and 1,083 other Christian slaves were freed, and the U.S. ransom money repaid.
After the First Barbary War, the European nations had been engaged in warfare with one another and the U.S. with the British. However, in the years immediately following the Second Barbary War, there was no general European war, which allowed the Europeans to build up their resources and challenge Barbary power in the Mediterranean without distraction. Algiers and Tunis were seized and colonized by France in 1830 and 1881, respectively.
ARTICLE 3rd The Dey of Algiers shall cause to be immediately delivered up to the American Squadron now off Algiers all the American Citizens now in his possession, amounting to ten more or less, and all the Subjects of the Dey of Algiers now in the power of the United States amounting to five hundred more or less, shall be delivered up to him, the United States according to the usages of civilized nations requiring no ransom for the excess of prisoners in their favor.
ARTICLE 2d It is distinctly understood between the Contracting parties, that no tribute either as biennial presents, or under any other form or name whatever, shall ever be required by the Dey and Regency of Algiers from the United States of America on any pretext whatever.