Why do communities with larger shares of ethnic and racial minorities have worse public goods provision? Many studies have emphasized the role of diversity in hindering public outcomes, but the question of causality remains elusive. The authors contribute to this debate by tracing the roots of both contemporary racial demography and public goods provision to the uneven historical expansion of the state. Focusing on new historical data from Brazil, the authors show that more remote municipalities with lower levels of state capacity in the past were more frequently selected by escaped slaves to serve as permanent settlements. Consequently, such municipalities have worse public services and larger shares of Afro-descendants today. These results highlight the pervasive endogeneity of the relationship between ethnic demography and public outcomes. The failure to account for contextdependent historical confounders raises concerns about the validity of previous findings regarding the social costs and benefits of any particular demographic composition.