This article examines the intersection between extraterritoriality--privileges afforded to European subjects in the Islamic Mediterranean--and various forms of state membership. To capture the multiplicity and instability of state membership, I introduce the phrase “legal belonging”--a neutral, umbrella term that encompasses a wide range of bonds between individuals and states (usually referred to as subjecthood, nationality, or citizenship). Adopting the methods of global legal history, I look at how laws regulating legal belonging responded to the extraterritorial context of the Mediterranean in both European and Middle Eastern states. In so doing, I offer an alternative to the centrifugal narrative of modernization, which presumes that modern citizenship was invented in Europe and then exported to the Islamic world. Instead, I contend that the evolution of legal belonging on both sides of the Mediterranean developed in response to the challenges and opportunities presented by extraterritoriality. The article consists of two cases studies: first, I look at the regulation of legal belonging in Tunisia, the Ottoman Empire, and Morocco, arguing that this legislation responded to the challenges posed by extraterritoriality. Second, I examine the influence of extraterritorial regimes on the nationality of Algerians under French colonial rule.