Diversity can pose fundamental challenges to state building and development. The Tanzanian Ujamaa policy— one of post-colonial Africa’s largest state-building experiments — addressed these challenges by resettling a diverse population in planned villages, where children received political education. We combine differences in exposure to Ujamaa across space and age to identify long-term impacts of the policy. Analysis of contemporary surveys shows persistent, positive effects on national identity and perceived state legitimacy. Our preferred interpretation, supported by evidence that considers alternative hypotheses, is that changes to educational content drive our results. Our findings also point to trade-offs associated with state building: while the policy contributed to establishing the new state as a legitimate central authority, exposure to Ujamaa lowered demands for democratic accountability and did not increase generalized inter-ethnic trust.