A large theoretical and empirical literature explores whether politicians and political parties change their policy positions in response to voters’ preferences. This paper asks the opposite question: do political parties affect public attitudes on important policy issues? Problems of reverse causality and omitted variable bias make this a difficult question to answer empirically. We study attitudes towards nuclear energy and immigration in Sweden using panel data from 290 municipal election areas. To identify causal effects, we take advantage of large nonlinearities in the function which assigns council seats, comparing otherwise similar elections where one party either barely wins or loses an additional seat. We estimate that a one seat increase for the anti-nuclear party reduces support for nuclear energy in that municipality by 18%. In contrast, when an anti-immigration politician gets elected, negative attitudes towards immigration decrease by 7%, which is opposite the party’s policy position. Consistent with the estimated changes in attitudes, the anti-nuclear party receives more votes in the next election after gaining a seat, while the anti-immigrant party experiences no such incumbency advantage. The rise of the anti-immigration party is recent enough to permit an exploration of possible mechanisms using several ancillary data sources. We find causal evidence that gaining an extra seat draws in lower quality politicians, reduces negotiated refugee quotas, and increases negative newspaper coverage of the anti-immigrant party at the local level. Our finding that politicians can shape public attitudes has important implications for the theory and estimation of how voter preferences enter into electoral and political economy models.