This paper uses the vote on the Swiss minaret initiative as a natural experiment to identify the causal effect of negative attitudes towards immigrants on foreigners' location choices and thus indirectly on their utility. Based on a regression discontinuity design with unknown discontinuity points and administrative data on the population of foreigners, we find that the probability of their moving to a municipality that unexpectedly expressed strong reservations decreases initially by about 60 percent. The effect levels off over a period of about 5 months. Consistent with a reduction in the identity utility for immigrants in general, the reaction is not confined to Muslims, whereby high-skilled foreigners seem to be most sensitive to the newly revealed reservations