The Barbary pirates, sometimes called Barbary corsairs or Ottoman corsairs, were 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, a term derived from the name of its Berber inhabitants. Their predation extended throughout the Mediterranean, south along West Africa's Atlantic seaboard and even South America, and into the North Atlantic as far north as Iceland, but they primarily operated in the western Mediterranean. In addition to seizing 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 as far away as Iceland. The main purpose of their attacks was to capture Christian slaves for the Ottoman slave trade as well as the general Arabic market in North Africa and the Middle East.
While such raids had occurred since soon after the Muslim conquest of the region, 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.