How do military alliances affect public support for defending targets of aggression? We studied this question by fielding an experiment on 14,000 voters in 13 member countries of the North Atlantic Treaty Organization (NATO). Our experiment involved a hypothetical scenario in which Russia attacked a target country. We randomly varied the identity of the target (Bosnia, Finland, Georgia, or Sweden), and whether the target was a member of NATO at the time of the attack. We found that voters in every member country were far more willing to use military force to defend each target when the target was in NATO, than when the target was outside the alliance. The expansion of NATO could, therefore, transform European security by altering the likelihood and scale of future wars. We also uncovered important heterogeneity across targets: the benefits of joining NATO were considerably larger for Bosnia and Georgia than for Finland and Sweden, since most voters in NATO countries would defend Finland and Sweden even if they remained outside the alliance. Finally, the effect of NATO was much stronger among voters who perceived NATO as valuable for their own country. Rhetorical attacks on NATO could, therefore, undermine the alliance by eroding the public's willingness to defend other members, whereas rhetoric highlighting the benefits of NATO could bolster defense and deterrence. These findings advance knowledge about the effects of alliances, while also informing policy debates about the value and size of NATO.