Previous research suggests that social identity influences public attitudes about the European Union, but little is known about the role of social identity for perceived legitimacy of the EU. This article explores the relation between different forms of identification (national, EU, dual) and EU legitimacy perceptions, and the moderation of this relationship by experienced threat to national power and sociocultural identity. A survey was conducted in six countries (N = 1136). A factor analysis of legitimacy items resulted in two subscales (institutional trust and duty to obey). Separate regression analyses were therefore run on these subscales. All forms of identification were positively related to perceived EU legitimacy, while threat was a strong and universal negative predictor. However, the results suggest that national identification only positively predicted legitimacy when participants experienced no threat to their nation by the EU, while dual identification positively predicted legitimacy even when participants experienced threat. Overall, respect for national identities and their values may offer opportunities to safeguard and improve the perceived legitimacy of the EU. Findings are discussed in terms of the literature on the ingroup projection model and the common ingroup model.