The paper discusses explanations for attitudes towards immigrants before and after the start of the 'migrant crisis'. Though the crisis caused changes in peoples' attitudes all over Europe, the Hungarian case is special due to the Hungarian government's intensive antiimmigration campaign. To explain the circumstances people encountered during the crisis and the campaign, we first prove that moral panic abounded in society. Then, we show the background effects which affected the emergence of attitudes towards immigration in a political context. In the second part of the paper, we introduce a path model to explain the presumed effect of migration. We analyze this model with regard to the different political party preference groups, assuming that the government's anti-immigration campaign affected people's opinions and that people with different party preferences had different attitudes towards immigration: namely, those who were sympathetic to the incumbent party had more negative attitudes towards immigration. This effect has two interpretations. The first is that those who sympathized with the incumbent party were more sensitive to its messages. The other is that those who resonated more with the campaign changed their party preference to favour Fidesz, but those who resonated less with the campaign but used to be sympathizers of Fidesz do not support them anymore. The models show that before the migrant crisis there were only slight differences between political preference groups regarding how anti-migrant attitudes arose. However, after the start of the crisis (and the campaign), diverse processes could be identified in the different political groups, especially in the case of Fidesz sympathizers.