Although the pacifying effect of gender equality is said to be a near-consensus, the causal mechanisms remain underspecified, and causal identification is weak. I address those shortcomings by providing the first causal evidence regarding the effects of women’s legislative representation on the state’s foreign military actions. I argue that women legislators affect foreign policies via legislative votes, and hence that the effect depends on whether military deployment requires legislative approval. I test the hypotheses by exploiting as-if random variation in mixed-gender close races and classifying the gender of 270,553 candidates in 253 legislative elections across 50 countries. The analysis indicates that women’s close victories reduced the state’s military actions but only with legislative veto power. The analysis of legislative votes also suggests that women legislators influenced other legislators and substantially reduced votes for military deployment. These results imply the crucial roles of legislatures in the gender-peace thesis.