We study the long-run effects of contact with individuals from other regions on beliefs, preferences and national identity. We combine a natural experiment, the random assignment of male conscripts to different locations throughout Spain, with tailored survey data. Being randomly assigned to complete military service outside of one’s region of residence fosters contact with conscripts from other regions, and increases sympathy towards people from the region of service, measured several decades later. We also observe an increase in identification with Spain for individuals originating from regions with peripheral nationalism. Our evidence suggests that intergroup exposure in early adulthood can have long-lasting effects on individual preferences and national identity.