In this paper, we analyse wage differences between foreign and Spanish nationals in Spain. This analysis is relevant because Spain has witnessed a sharp increase in the proportion of foreign workers over the past decade. In our analysis, we explicitly account for unobserved heterogeneity at firm level, a situation which occurs when relevant covariates (for example, those connected to a specific ... [Show full abstract] firm's production process) are not included in the model because they are unmeasurable, unobservable or unavailable for the researcher. When accounting for such heterogeneity, our results show that wage gaps between foreign nationals from developing countries and Spanish nationals range between −6.35 per cent and −11.30 per cent. We also find that wage differences, between Spanish nationals and others in the same firm and job, are substantially greater for almost every group of low-tenured foreign workers and also for those holding open-ended contracts.