We exploit the quasi-random allocation of asylum seekers across Swiss cantons and the high frequency of national referenda to identify the causal effect of immigration on political outcomes in receiving countries. We find that the arrival of asylum seekers causes voters to increase their support for right-wing and conservative policies. However, this effect is driven by episodes of unusually high inflows of asylum seekers. Moreover, we find that for votes on immigration and refugee policy, the arrival of more asylum seekers shifts voters towards policies endorsed by conservative and centre-right parties but not towards positions backed by the rightmost anti-immigration party. In contrast, the shift towards the rightmost stances is sizeable in votes related to the welfare state, international integration, and the rights of minorities.