In Western European welfare states, research shows that support for welfare chauvinism, or the notion that welfare benefits for immigrants should be restricted, is highest among white, blue-collar working-class voters. On the other hand, higher-educated, middle-class voters are more likely to reject welfare chauvinism and support the inclusion of immigrants into the welfare state. For social democratic parties, this might pose an electoral dilemma between generous welfare states and open borders: They rely on both middle- and working-class constituencies and are ideologically tied both to a universal welfare state and the protection of (national) workers. To what extent does such an electoral dilemma between classes exist for social democratic parties? How do social democratic parties solve this dilemma when in government? In this paper, we postulate that a class divide around welfare chauvinism exists within the electorate for social democratic parties and that these parties’ policies in government reflect these divides: If the social democratic electorate has a high share of working-class voters, they should act more welfare chauvinist than if their electorate is mostly middle class. We test these hypotheses by combining survey and macro-level policy data in 14 Western European countries from 1980 to 2018. We find consistent evidence of the existence of a working-class/middle-class divide regarding welfare chauvinism, even within social democratic electorates. On the macro-level, we find partial evidence that social democratic parties in power respond to the class demands of their electorate: They are less welfare chauvinist when they have a higher proportion of middle-class voters, whereas their working-class vote share does not significantly condition their policies at all, contrary to assumptions in the literature. We therefore conclude that as social democratic parties become parties of the middle classes, the likelihood that they will retrench immigrant welfare rights reduces.