New research suggests a pretty straightforward way to bust gender stereotypes: Get men and women to work closely alongside each other.

A new working paper (paywall) published in the National Bureau of Economic Research explains the results of an experiment conducted within Norway’s military in 2014. Women are just a small minority (13%) in the country’s armed forces. The researchers wanted to find out whether integrating women into squads that were typically all-male during an eight-week boot camp would prompt men to adopt more egalitarian attitudes.

To establish baseline attitudes, the researchers asked both men and women at the start of boot camp to answer a series of questions that examined their beliefs about gender. The experiment, which included 781 men and 119 women, asked them to rank their level of agreement or disagreement with questions related to gender, including the following:

  • “Teams perform better when made up of the same sex.”
  • “It is important for men and women to share household work equally.”
  • “I am feminine.” (This last assertion was included in a series of other questions asking about personality traits.)

The results showed clear divisions along gender lines. Just 10% of the women said they believed that same-sex teams performed better than mixed-gender teams, compared to 37% for the men. Similarly, 88% of the women said that men and women should divide housework equally, compared to two-thirds of the men. And while virtually no men said that “feminine” was a good description of them, 58% did not completely dismiss the idea that their personalities could contain some aspect of femininity. (Most women said that they were feminine to some extent.)

Over the next eight weeks, the mixed-gender squads lived and worked together, sharing the same sleeping quarters and training together. The end result? Men who had spent intensive amounts of time alongside their female colleagues became significantly more egalitarian in their attitudes.

“Our first result is that men who have women randomly assigned to their squads are 14 percentage points more likely to think mixed-gender teams perform as well or better than same-gender teams,” the authors said. The men who had been in mixed-gender squads were 8 percentage points more likely to believe that men and women should equally divide housework, and 14 percentage points more likely not to disavow their feminine side. “These are sizable swings which move men closer to the attitudes of women,” the authors conclude. “Depending on the outcome, treatment reduces the gap in mean attitudes between men and women by between 31 and 46 percent.”

Why is it that spending time in mixed-gender groups can change men’s attitudes about women? The authors suggest that one possible explanation is contact theory, or the “contact hypothesis,” developed in the 1950s as a means of counteracting bias. “That theory predicts that mixing groups will break down stereotypes, especially if they are given equal status and have common goals,” writes Gordon Dahl, one of the study’s co-authors and a professor of economics at the University of California, San Diego. “Men exposed to women are able to observe firsthand the positive contributions women can make to the team.”

The results of the Norway experiment lend support to the idea that integrating women into other male-dominated occupations can go a long way toward dispelling stereotypes, according to Dahl. “We have in mind occupations like police officers or STEM occupations which have few women in them,” he writes. “Exposure to women in these settings could break down some of the gender barriers which exist by changing men’s attitudes.”