This study examines the effects of national and cosmopolitan self-identity on xenophobic attitudes across 33 countries with a multilevel analysis of data from the National Identity Module III of the International Social Survey Programme. Of primary interest is how country contexts are intertwined with the sense of national belonging to predict individuals’ anti-immigrant attitudes. The study finds that individuals with a stronger ethnicity-based national identity tend to evidence stronger xenophobia. Net of the individual-level effect of ethnic national identity, citizens of countries with a higher average of ethnic national identity also tend to be more xenophobic. Interestingly, the link between ethnic national identity and xenophobia is stronger in countries where this perspective is not shared as strongly. In the seemingly more ‘open’ country context, individuals’ belief in the requirement of ancestral roots for national membership may entail stronger exclusivism as a fringe ideology.