thumb|A Sea Fight with Barbary Corsairs by [[Laureys a Castro, 1681]]
thumb|Barbaria by [[Jan Janssonius, shows the coast of North Africa, an area known in the 17th century as Barbaria, c. 1650]]
thumb|An Algerine pirate ship
thumb|upright|A man from the Barbary states
thumb|upright|A Barbary pirate, [[Pier Francesco Mola, 1650]]
The Barbary corsairs, also known as the Barbary pirates, Ottoman corsairs, or naval mujahideen (in Muslim sources), were mainly Muslim corsairs and privateers who operated from the North African coast, known in Europe as the Barbary Coast. In addition to seizing merchant ships, they engaged in razzias—raids on European coastal towns and villages, mainly in Italy, France, Spain, and Portugal, as well as Great Britain, Ireland, and Iceland (commemorated as the Turkish Abductions). Hayreddin Barbarossa and Oruç Reis, the 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. 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 remainder of the threat was finally subdued for Europeans by the French conquest of Algeria in 1830 and continuous campaigns and colonization by the French during the mid-to-late 19th century.
History
The Barbary corsairs were active from medieval times to the 1800s.
Muslim historical narratives
Both Europeans (e.g., the Dum Diversas) and Muslims considered themselves to be waging holy wars against each other during this era. European and American historical sources bluntly consider these operations to be a form of piracy and that their goal was mainly to seize ships to obtain spoils, money, and slaves. Muslim sources, however, sometimes refer to the "Islamic naval jihad"—casting the conflicts as part of a sacred mission of war under Allah, differing from the more familiar form of jihad only in being waged at sea. Accounts of Andalusian Muslims being persecuted by the Spanish Inquisition—willingly abetted by the Catholic Monarchs of Spain, who (though inaugurating what would later become Spain's "Golden Age") were initially faced with the post-Reconquista necessity of binding their (hitherto-divided) territories together, and hence adopted a militantly Christian national identity—provided more than enough justification, in Muslim eyes.
thumb|British captain witnessing the miseries of Christian slaves in Algiers, 1815
The Middle Ages
In 1198, the problem of Barbary piracy and slave-taking was so significant that the Trinitarians, a religious order, was founded to collect ransoms and even to exchange themselves as a ransom for those captured and pressed into slavery in North Africa. In the 14th century, Tunisian corsairs became enough of a threat to provoke a Franco-Genoese attack on Mahdia in 1390 (also known as the "Barbary Crusade"). Moorish exiles of the Reconquista and Maghreb pirates added to the numbers, but it was not until the expansion of the Ottoman Empire and the arrival of the privateer and admiral Kemal Reis in 1487 that the Barbary corsairs became a true menace to shipping from European Christian nations.
16th century
thumb|left|[[Battle of Preveza, 1538]]
From 1559, the North African cities of Algiers, Tunis, and Tripoli, although nominally part of the Ottoman Empire, were autonomous military republics that chose their rulers and lived by war booty captured from the Spanish and Portuguese. There are several cases of Sephardic Jews, including Sinan Reis and Samuel Pallache, who upon fleeing Iberia attacked the Spanish Empire's shipping under the Ottoman flag.
During the first period (1518–1587), the beylerbeys were admirals of the sultan, commanding great fleets and conducting war operations for political ends. They were slave hunters, and their methods were ferocious. After 1587, the sole object of their successors was plundering, both on land and sea. The maritime operations were conducted by the captains, or reises, who formed a class or even a corporation. Cruisers were fitted out by investors and commanded by the reises. 10% of the value of the prizes was paid to the pasha or his successors, who bore the titles of agha or dey or bey.
thumb|The Barbary corsairs frequently attacked Corsica, resulting in many [[Genoese towers being erected.]]
In 1544, Hayreddin captured the island of Ischia, taking 4,000 prisoners, and enslaved some 2,000–7,000 inhabitants of Lipari. In 1551, Turgut Reis enslaved the entire population of the Maltese island of Gozo, between 5,000 and 6,000, sending them to Ottoman Tripolitania. In 1554, corsairs under Turgut Reis sacked Vieste, beheaded 5,000 of its inhabitants, and abducted another 6,000.
17th century
thumb|left|The work of the [[Mercedarians was in ransoming Christian slaves held in Muslim hands, Histoire de Barbarie et de ses Corsaires, 1637]]
In the early years of the 17th century, the Barbary states attracted English pirates, many of whom had previously operated as privateers under Queen Elizabeth I. Still, they found themselves unwanted by her successor King James VI and I. Whereas in England, these pirates were reviled, in the Barbary states, they were respected and had access to safe markets to resupply and repair their ships. Many of these pirates converted to Islam.
A notable Christian action against the Barbary states occurred in 1607, when the Knights of Saint Stephen (under Jacopo Inghirami) sacked Bona in Algeria, killing 470 and taking 1,464 captives. This victory is commemorated by a series of frescoes painted by Bernardino Poccetti in the "Sala di Bona" of Palazzo Pitti, Florence. In 1611, Spanish galleys from Naples, accompanied by the galleys of the Knights of Malta, raided the Kerkennah Islands off the coast of Tunisia and took away almost 500 Muslim captives. Between 1568 and 1634, the Knights of Saint Stephen may have captured about 14,000 Muslims, with perhaps one-third taken in land raids and two-thirds taken on captured ships. England was also subject to pirate raids; in 1640, 60 men, women and children were enslaved by Algerian corsairs who raided Penzance.
Another major figure was Moulay Ismail, the second ruler of the 'Alawi dynasty of Morocco. He was not a pirate himself, but encouraged and benefited from their operations, especially the slaves they captured and delivered.
More than 20,000 captives were said to be imprisoned in Algiers alone. The rich were often able to secure release through ransom, but the poor were condemned to slavery. Their masters would, on occasion, allow them to secure freedom by professing Islam. A long list might be given of people of good social position, not only Italians or Spaniards but German or English travelers in the south, who were captives for a time.
<gallery mode=packed>
File:A French Ship and Barbary Pirates (c 1615) by Aert Anthoniszoon.jpg|A French Ship and Barbary Pirates by Aert Anthonisz,
File:Théodore Gudin-Combat d'un vaisseau français et de deux galères barbaresques mg 5061.jpg|Battle of a French ship of the line and two galleys of the Barbary corsairs
File:Willem van de Velde de Jonge - Een actie van een Engels schip en schepen van de Barbarijse zeerovers.jpg|An action between an English ship and vessels of the Barbary Corsairs
File:Action Between the Dutch Fleet and Barbary Pirates RMG BHC0849.tiff|Lieve Pietersz Verschuier, Dutch ships bomb Tripoli in a punitive expedition against the Barbary pirates,
</gallery>
<span class="anchor" id="18th-19th centuries"></span><span class="anchor" id="Barbary Coast Wars"></span><span class="anchor" id="Barbary Wars"></span> 18th–19th centuries
thumb|upright|Captain [[William Bainbridge paying tribute to the Dey of Algiers, c. 1800]]
Piracy was enough of a problem for some states to enter the redemption business. In Denmark:
