Piracy was an early and constant subject of negotiation between the Ottomans and their European treaty partners, who developed a legal and diplomatic framework prohibiting piratical violence and establishing the procedures for redress when attacks did occur. The anti-piracy provisions of these treaties (ahdname) were regularly expanded and modified to meet changing circumstances, even as the club of treaty partners expanded beyond Venice to include France (1569), England (1580), and the Netherlands (1612). However, developments around the turn of the seventeenth century threatened to bring down the entire order upon which the treaty regime was founded. While the predations of English and Dutch pirates and privateers proved vexing to the Ottomans, it was the increasingly independent North African corsairs who posed the greatest political and religious-legal challenge to Istanbul. This paper explores the relationship between Istanbul and the corsairing ports of Algiers, Tunis, and Tripoli in the seventeenth century, tracing the reasons for and consequences of the diplomatic divergence that led England, France, and the Netherlands to conclude treaties directly with the North African provinces. Unresolved disagreements over what constituted legal raiding and what was piracy, the result of a series of Algerian-Tunisian piratical raids in the 1620s and 1630s, led to a permanent restructuring of the imperial center’s relationship with North Africa. Since the turn of the century, European jurists had been asking themselves whether Algiers, Tunis, and Tripoli were sovereign, in which case their corsairs were legitimate enemies and their takings lawful prizes, or rebellious Ottoman provinces and nests of pirates? Istanbul resisted acknowledging the former, but the North Africans’ arrogation to themselves of the right to declare war and peace convinced it to wash its hands of responsibility for their corsairs’ predations. Istanbul granted explicit permission by decree and in the treaty texts themselves to its European treaty-partners to destroy any corsairs who threatened them, creating the conditions that led to dozens of European punitive expeditions against the North African port cities beginning in the 1660s and culminating in the French invasion of Algiers in 1830—attacks that Istanbul did not consider to be acts of war against the Ottoman Empire.