Barbary States, term used for the North African states of Tripolitania, Tunisia, Algeria, and Morocco. From the 16th cent. Tripolitania, Tunisia, and Algeria were autonomous provinces of the Turkish Empire. Morocco pursued its own independent development. The corsair Barbarossa and his brothers led the Turkish conquest to prevent the region from falling to Spain. A last attempt by Holy Roman Emperor Charles V to drive out the Turks failed in 1541. The piracy carried on thereafter by the Muslims of North Africa began as part of the wars against Spain. In the 17th and 18th cent., when the Turkish hold on the area grew weaker, the raids became less military and more commercial in character. The booty, ransom, and slaves that resulted from attacks on Mediterranean towns and shipping and from occasional forays into the Atlantic became the main source of revenue for local Muslim rulers. All the major European naval powers made attempts to destroy the corsairs, and British and French fleets repeatedly bombarded the pirate strongholds. Yet, on the whole, countries trading in the Mediterranean found it more convenient to pay tribute than to undertake the expensive task of eliminating piracy. Toward the end of the 18th cent. the power of the piratical states diminished. The United States and the European powers took advantage of this decline to launch more attacks. American opposition resulted in the Tripolitan War. After the Napoleonic wars, European opinion clearly favored destroying the pirates. In 1816 Lord Exmouth with an Anglo-Dutch flotilla all but ended the naval power of the dey of Algiers. An ultimatum from the European Congress of Aix-la-Chapelle (1819) compelled the bey of Tunis to give up piracy. The Tunisian fleet was subsequently sent to help the Ottomans in Greece and was destroyed (1827) at the battle of Navarino. In 1830, France, after a three-year blockade of Algiers, began the conquest of Algeria. The Ottoman Turks were able to reassert (1835) direct control over Tripolitania and end piracy there. About the same time the sultans of Morocco, who had occasionally encouraged piracy, were forced by France, Great Britain, and Austria to give up plans to rebuild the Moroccan fleet, and North African piracy was at an end.