Religion is often touted as a force for moral good in the world—but it has a sinister side, too, embodied by gruesome rituals like human sacrifice. Now, new research suggests that even this dark side may have served an important function. Scientists have found that these ceremonial killings—intended to appease gods—may have encouraged the development of complex civilizations in maritime Southeast Asia and the South Pacific, though some experts remain unconvinced.

Human sacrifice was part of many traditional cultures across the globe, marking important events like the death of a leader or the construction of a house or boat. In the islands of the Indian and Pacific oceans, powerful chiefs or priests usually carried out the grim rites. They dispatched powerless individuals—often slaves—by cutting off their heads, beating them to death, or crushing them with canoes until they died.

These horrific deeds may have had some unexpected benefits, at least for some members of society. According to a religious evolutionary theory called the “social control hypothesis,” social elites may have used human sacrifice to preserve their power, cementing their status by claiming supernatural approval for their acts. “There is anecdotal evidence from other areas of the world that human sacrifice was used to maintain and control populations,” says psychologist Joseph Watts, a doctoral student who studies cultural evolution at the University of Auckland in New Zealand. But until now, he says, it hadn’t been systematically tested.

So Watts and his colleagues analyzed 93 traditional Austronesian societies to fill that gap. Austronesians, who share a common ancestral language, originated in Taiwan and fanned outward across the Indian and Pacific oceans, from Madagascar to Easter Island and as far south as New Zealand. By combing through historical and ethnographic accounts, the researchers identified which cultures practiced human sacrifice prior to contact with modern industrialized nations. They also classified each society’s level of social stratification as “egalitarian,” “moderately stratified,” or “highly stratified.” In egalitarian cultures, rank and power were not passed down through generations. Moderately stratified societies allowed for inherited status, but without pronounced social classes. In highly stratified societies, class differences were strict, social mobility restricted, and stature largely inherited.

Based on linguistic clues, the scientists built family trees showing how the Austronesian cultures likely evolved and how they are related. It’s a technique the group has used in the past to suggest that belief in supernatural punishment promotes political complexity. The family trees allowed them to estimate whether human sacrifice and social stratification arose in the same places, and whether ritualized killings drove changes in class divisions.

Some cultures at each level of social stratification engaged in human sacrifice, but it was more common in those that were harshly divided: Two-thirds of the highly stratified societies practiced the macabre ritual, compared with just one-quarter of the egalitarian societies, the researchers report online today in Nature. The family trees show that human sacrifice and social stratification evolved together. The timing of the traits’ evolution—human sacrifice came first—suggests that cultures were more likely to become strictly divided along class lines if their religious traditions included the grisly rite.

“People often claim that religion underpins morality,” Watts says. This study, however, highlights another aspect of belief in the divine. “It shows how religion can be exploited by social elites to their own benefit.”

That’s a compelling conclusion, says human evolutionary anthropologist Joseph Henrich of Harvard University, but he urges skepticism in using language trees to interpret cultural practices. By assuming that human behaviors evolved exactly the same way that vocabularies did, the method ignores the possibility that behaviors may have spread between neighboring cultures, Henrich says. That could have happened, for example, when one society conquered another.

Heinrich says there’s “no evidence” to support or disprove the link between cultural practices and Austronesian family trees. The way to verify that association, he adds, would be to analyze a test case—a behavior with a known evolution. If Austronesian culture and language are connected, then the prediction of the family trees should match the historical record.

Still, experts welcome the injection of sophisticated statistical techniques into research on religion and culture. “The study of religion has been plagued in many ways by an abundance of ideas and a shortage of strong quantitative tests of these ideas,” says human behavior ecologist Richard Sosis of the University of Connecticut, Storrs. “These methods have power, and they are certainly an advance in the way we can evaluate ideas. Are they the last piece to the puzzle? No.” But, he adds, “at least the conversation can begin here and begin in a systematic way that hasn’t happened before.”