States traditionally build walls to repel the armies of adversaries and consolidate control over territory. More recently, the growth in violence by nonstate groups has led governments to use fences to prevent insurgent activity and transnational terrorism. This practice, which has accelerated since the end of World War II, challenges liberal expectations of a borderless world. We use a new and unique data set on twentieth century interstate border barriers to evaluate the effectiveness of fencing as a defense against transnational terrorist attacks. The strategic nature of barrier construction makes the assessment of causal effects complex. However, our analyses suggest that fences reduce the annual relative risk of a terrorist attack by at least 67 percent. Much of the literature on transnational terrorism focuses on variables such as democracy, development, and distance—that is, factors that are difficult for policy-makers to manipulate. But our analysis suggests that fencing may provide an effective policy tool for leaders seeking to insulate their states from transnational terrorist attacks.