We investigate the origin and evolution of the legal institution of citizenship from a political economy perspective. We compile a new data set on citizenship laws across countries of the world which documents how these institutions have evolved in the postwar period. We show that, despite a persistent impact of the original legislation, they have responded endogenously and systematically to a number of economic determinants, such as migration, the size of government, and the demographic structure of the population. Overall, a large stock of migrants decreases the probability of adoption of a mix of jus soli and jus sanguinis provisions, while it pushes jus sanguinis countries toward the adoption of jus soli elements. The welfare burden proves not to be an obstacle for a jus soli legislation, while demographic stagnation encourages the adoption of mixed and jus soli regimes. We also gauge the potential role of legal, political and cultural determinants, and find that a jus sanguinis origin is a factor of resistance to change, that a high degree of democracy promotes the adoption of jus soli elements while the instability of state borders associated with decolonization impedes it, and that cultural factors have no impact.