The Barbary pirates, or Barbary corsairs or Ottoman corsairs, were Muslim pirates and privateers who operated from North Africa, based primarily in the ports of Salé, Rabat, Algiers, Tunis, and Tripoli. This area was known in Europe as the Barbary Coast, in reference to the Berbers. Their predation extended throughout the Mediterranean, south along West Africa's Atlantic seaboard and into the North Atlantic as far north as Iceland, but they primarily operated in the western Mediterranean. In addition to seizing merchant ships, they engaged in Razzias, raids on European coastal towns and villages, mainly in Italy, France, Spain, and Portugal, but also in the British Isles, the Netherlands, and Iceland. The main purpose of their attacks was to capture slaves for the Ottoman slave trade as well as the general Arab slavery market in North Africa and the Middle East. Slaves in Barbary could be of many ethnicities, and of many different religions, such as Christian, Jewish, or Muslim.
While such raids had occurred since soon after the Muslim conquest of Iberian Peninsula in the 710s, the terms "Barbary pirates" and "Barbary corsairs" are normally applied to the raiders active from the 16th century onwards, when the frequency and range of the slavers' attacks increased. In that period Algiers, Tunis and Tripoli came under the sovereignty of the Ottoman Empire, either as directly administered provinces or as autonomous dependencies known as the Barbary States. Similar raids were undertaken from Salé and other ports in Morocco.
Barbary corsairs captured thousands of merchant ships and repeatedly raided coastal towns. As a result, residents abandoned their former villages of long stretches of coast in Spain and Italy. Between 100,000 and 250,000 Iberians were enslaved by these raids.
The raids were such a problem that coastal settlements were seldom undertaken until the 19th century. Between 1580 and 1680 corsairs were said to have captured about 850,000 people as slaves and from 1530 to 1780 as many as 1,250,000 people were enslaved. However, these numbers have been questioned by the historian David Earle. Some of these corsairs were European outcasts and converts (renegade) such as John Ward and Zymen Danseker. Hayreddin Barbarossa and Oruç Reis, Turkish Barbarossa Brothers, who took control of Algiers on behalf of the Ottomans in the early 16th century, were also notorious corsairs. The European pirates brought advanced sailing and shipbuilding techniques to the Barbary Coast around 1600, which enabled the corsairs to extend their activities into the Atlantic Ocean.[unreliable source?] The effects of the Barbary raids peaked in the early to mid-17th century.
Long after Europeans had abandoned oar-driven vessels in favor of sailing ships carrying tons of powerful cannon, many Barbary warships were galleys carrying a hundred or more fighting men armed with cutlasses and small arms. The Barbary navies were not battle fleets. When they sighted a European frigate, they fled.
The scope of corsair activity began to diminish in the latter part of the 17th century, as the more powerful European navies started to compel the Barbary States to make peace and cease attacking their shipping. However, the ships and coasts of Christian states without such effective protection continued to suffer until the early 19th century. Between 1801 and 1815, occasional incidents occurred, including two Barbary wars waged by the United States, Sweden and the Kingdom of Sicily against the Barbary States. Following the Napoleonic Wars and the Congress of Vienna in 1814–15, European powers agreed upon the need to suppress the Barbary corsairs entirely. The threat was finally subdued by the French conquest of Algeria in 1830 and subsequent pacification by the French during the mid-to-late 19th Century.