We study how friendship shapes students’ political opinions in a natural experiment. We use an indicator for whether two students were exogenously assigned to a short-term “integration group”, unrelated to scholastic activities and dissolved before the school year begins, as an instrumental variable for their friendship, to estimate the effect of friendship on pairwise political opinion outcomes in dyadic regressions. After six months, friendship causes a reduction of differences in opinions by one quarter of the mean difference. It likely works through a homophily-enforced mechanism, by which friendship causes politically-similar students to join political associations together, which reinforces their political similarity. The effect is strong among initially similar pairs, but absent in dissimilar pairs. Friendship affects opinion gaps by reducing divergence, therefore polarization and extremism, without forcing individuals’ views to converge. Network characteristics also matter to the friendship effect.