Abstract The harmful mental health effects of perceived discrimination are well established. Yet, the role of regional-level social capital in mitigating these effects remains underexplored. Using data from the German Socioeconomic Panel (SOEP; 2010-2021) we apply random effects models to assess the effect of perceived discrimination on mental health (mcs subscale of the SF-12) adjusting for individual socio-demographic factors and regional-level socioeconomic deprivation. We assess interaction with general social capital (civic organisations, electoral turnout, generalised trust) and migrant-specific resources (proportion of non-nationals and share of far-right votes). We juxtapose non-refugee migrants (n = 13478) with refugees subject to mobility restrictions (n = 5558) to assess for bias introduced by selective mobility into regions. In the non-refugee sample, we confirm negative effects of frequent discrimination experiences on mcs (ß: -3.74; 95%CI: -4.39, -3.08). Moderation analyses show insignificant results for general social capital, but a negative interaction effect of proportion of non-nationals (ß: -0.71; 95%CI: -1.34, -0.08). Analyses among refugees confirm the negative effect of discrimination on mcs (ß: -6.29; 95%CI: -7.49, -5.08) and the moderating effect of the proportion of non-nationals (ß: -1.63; 95%CI: -2.78, -0.48), as well as showing a positive moderation effect for generalised trust (ß: 0.84; 95%CI: 0.11-1.57). Results demonstrate the negative implications of living in areas with a high proportion of non-nationals for migrants experiencing discrimination, which may be explained by the higher marginalisation of migrants in these areas and increased service access barriers. The absence of a moderation effect of general social capital appears to be the result of selection bias, with positive effects of generalised trust seen for refugee migrants. Key messages • Ethnic discrimination affects mental health of refugee and non-refugee migrants. • The effect of discrimination on mental health are stronger in areas with higher proportion of non-nationals.