Fifty years ago this month, the British government sent troops to Northern Ireland to impose control as relations broke down between Protestants and Catholics. The ensuing violence, known as “the Troubles,” lasted 33 years and led to over 3,000 deaths, including 1,617 in Belfast alone. Why did Northern Ireland — a jurisdiction of an advanced industrial nation — suffer such sustained violence? In new research, we examine one important factor. Catholics and Protestants lived side by side, but they had very few social or economic ties across the communities. This meant geographic proximity bred violence instead of mutual tolerance.

The Troubles were sparked by tit-for-tat violence

To understand the Northern Ireland conflict, you need to know a little history. In 1919, the Irish revolted against British rule, resulting in an independent Irish state in the island’s 26 southern counties. But the six counties of Northern Ireland remained part of the United Kingdom. Unionist — meaning, pro-British — Protestants were a majority of the population in Northern Ireland and effectively ran the state, shutting Irish-identified Catholics out of jobs and political power through discrimination and gerrymandering. In the late 1960s, Catholics held civil rights demonstrations, to which the Protestant government responded with violence, setting in motion a cycle of rioting and tit-for-tat sectarian violence in cities such as Belfast and Derry/Londonderry.

In 1969, the British military intervened to keep the rioting factions apart. The Irish Republican Army launched an armed campaign to wrest Northern Ireland from British rule. The conflict ended when the two sides reached the so-called “Good Friday Agreement'' in May 1998, in which Sinn Féin, the political arm of the Catholic paramilitaries, and Protestant unionist parties agreed to share power. The agreement outlined a process by which the IRA and loyalist paramilitaries disarmed.

Data helps explain how the conflict unfolded

Very often, ethnic groups fight each other in countries where the government is weak. As a result, researchers cannot find very good data on fundamental facts about the population, such as who lived where. But even during the Troubles, Northern Ireland kept excellent census data and good information about the number and location of conflict-related deaths.

With these data, we can examine whether mixed neighborhoods — neighborhoods in which Protestants and Catholics lived together — led to greater mutual tolerance or greater conflict. One could make a plausible argument for either. If you live next to people from a different religious or ethnic community, you might learn to understand them, to see them as individual human beings, and hence to tolerate them. Or living alongside people you see as alien might increase your hostility toward them and offer more chances for conflict.

So which is it? The answer could help solve important policy questions. Some experts believe ethnic conflicts are best resolved by “partition” — separating communities geographically. Others believe desegregation is more likely to result in long term peace, as individuals from different ethnic groups work and play together in shared neighborhoods.

Diverse neighborhoods had higher numbers of deaths

We found some answers in our Northern Ireland data. The first figure below shows where conflict-related deaths happened in Belfast. The second shows the pattern of where Protestants and Catholics lived in Belfast; in that figure, the greener the area, the higher the percentage of Catholics in the population.

Our research finds that, on average, more people were killed in the most diverse parts of Belfast.

But why? Why didn’t living together help people become more comfortable with and peaceful toward one another? Historical accounts suggest that while many Protestants and Catholics lived in mixed neighborhoods for generations before the conflict, they generally did not marry one another or attend school together. Workplace segregation was common as well, as Protestants shut Catholics out of higher-paying jobs and business associations. In other words, Protestants and Catholics in mixed neighborhoods never created social ties or a shared sense of community. Instead of generating tolerance, geographic proximity resulted in more intense violence.

Good fences make good neighbors?

These findings suggest that in the absence of true social integration, “ethnic partition” may be a better strategy than geographic integration. Without meaningful social or economic links across the communities, diversity can make violence more intense.

However, these data cannot tell us whether ethnic hostility would abate if the communities developed shared social and economic networks through integrated workplaces, schools, voluntary associations and governance bodies. Research in other contexts — for instance, Hindu-Muslim violence in India — has found that mixed communities with deep economic and social interdependence are less prone to ethnic violence. Community leaders in Northern Ireland — politicians, academics and civil society — have been recommending social integration combined with residential desegregation for decades.

A British exit from the European Union probably requires the reestablishment of a “hard” border between Northern Ireland and the Republic of Ireland. The reestablishment of the border abrogates a key principle of the 1998 peace agreement and threatens several related treaty provisions that fostered interdependence and trust between nationalist Catholics and unionist Protestants. These provisions included shared governance structures, with guaranteed representation for Catholics. The Republic of Ireland’s accession to the treaty also assured northern Catholics that their rights would be guaranteed under British rule, and assured unionists that the south would not seek to assert its sovereignty over the British north. The Belfast agreement also enabled cooperative cross-border development projects that benefited both ethnic groups.

Moreover, the free flow of goods and labor increases the interdependence between northern Protestants and Irish-identified Catholics. Increasingly routine encounters with Irish citizens arguably spills over into increased trust with Catholics in the north. Finally, there is the fact that northerners and southerners, Protestants and Catholics, were all E.U. citizens, with shared stakes in the success of the E.U.’s economic and political integration. Absent a shared stake — in the E.U., in north-south cooperation, in governing institutions, in economic interdependence — it is easy to see how trust might erode in a post-Brexit future.

Joseph M. Brown is an assistant professor of political science at the University of Massachusetts Boston.

Gordon C. McCord (@gcmccord) is an assistant teaching professor of economics at the University of California, San Diego.