During the War of 1812, the Barbary States had stepped up attacks on American shipping. These states, which were nominally vassals of the Ottoman Empire but were functionally independent, demanded tribute from countries that traded in the Mediterranean Sea. With the end of the war, the United States could deploy the now-expanded U.S. Navy against the Barbary States. Congress declared war on Algiers in March 1815, beginning the Second Barbary War. Seventeen ships, the largest U.S. fleet that had been assembled up to that point in history, were sent to the Mediterranean Sea. After several defeats, Algiers agreed to sign a treaty, and Tunis and Tripoli also subsequently signed treaties. The Barbary States agreed to release all of their prisoners and to stop demanding tributes.Wood, 2009, pp. 696–697.
