With the transformation of Spain into an immigration country, society has become a major change by setting up a social space characterized, increasingly, by cultural, ethnic and religious diversity. In this new frame is interesting to investigate the overall value of diversity into the Spanish society. The two aims for of this paper are, on one hand, to process feedback on Spanish opinion on immigration between 1996 and 2007, and, on the other hand, to find out the role of the media in the construction of that opinion. For the first aim, an index of anti-foreigner sentiments was constructed using data provided by the national survey on opinions and attitudes on immigration, published annually by ASEP. For the second, an analysis, using the Agenda-Setting Theory, of articles published on immigration that appeared in the newspapers, «El País» and «El Mundo». The results show that a negative sentiment towards the outgroup has increased over time. The main variables explaining these trends are a sense of threat, to the population and to identity, and competition for resources and political decisions in integration – legalisation. The media analysis has six dimensions, the main ones refer to the illegality of the phenomenon, linking immigration to crime, and the social integration policies, highlighting the role of the media in creating public opinion.