We show how local segregation and exposure to partisans affect political behavior and polarization, and contribute to critical ideological realignment. We exploit large-scale, exogenous and high-stakes peer assignment due to universal conscription of soldiers assigned from each of 34,947 French municipalities to infantry regiments during WWI. Soldiers from poor, rural municipalities, where the redistributive message of socialism had yet to penetrate, vote more for the left after the war when exposed to left-wing partisans within their regiment, even while neighbouring municipalities assigned to right-wing partisans become inoculated against the left. We provide evidence that these differences reflect the combination of persuasive information and material incentives rather than pure conformity. These differences further lead to the emergence of sharp and enduring post-war discontinuities across regimental boundaries that are reflected, not only in divergent voting patterns, but also in violent civil conflicts between Collaborators and the Resistance during WWII.