We examine whether exposure of men to women in a traditionally male-dominated environment can change attitudes about mixed-gender productivity, gender roles and gender identity. Our context is the military in Norway, where we randomly assigned female recruits to some squads but not others during boot camp. We find that living and working with women for 8 weeks causes men to adopt more egalitarian attitudes. There is a 14 percentage point increase in the fraction of men who think mixed-gender teams perform as well or better than same-gender teams, an 8 percentage point increase in men who think household work should be shared equally and a 14 percentage point increase in men who do not completely disavow feminine traits. Contrary to the predictions of many policymakers, we find no evidence that integrating women into squads hurt male recruits satisfaction with boot camp or their plans to continue in the military. These findings provide evidence that even in a highly gender-skewed environment, gender stereotypes are malleable and can be altered by integrating members of the opposite sex.