Many theories of international relations assume that public opinion exerts a powerful effect on foreign policy in democracies. Previous research, based on observational data, has reached conflicting conclusions about this foundational assumption. We use experiments to examine two mechanisms—responsiveness and selection—through which opinion could shape decisions about the use of military force. We tested responsiveness by asking members of the Israeli parliament to consider a crisis in which we randomized information about public opinion. Parliamentarians were more willing to use military force when the public was in favor and believed that contravening public opinion would entail heavy political costs. We tested selection by asking citizens in Israel and the US to evaluate parties/candidates, which varied randomly on many dimensions. In both countries, security policy proved as electorally significant as economic and religious policy, and far more consequential than nonpolicy considerations such as gender, race, and experience. Overall, our experiments in two important democracies imply that citizens can affect policy by incentivizing incumbents and shaping who gets elected.