In Japan, it was said that sacrificing a woman at a rushing river would placate the spirit who lived there, allowing for the construction of bridges and the safe passage of boats. In Greek myth, the warrior king Agamemnon decides to kill his own daughter in exchange for a favorable wind on the way to Troy. The Egyptians buried some of their pharaohs with dozens of servants when they died, ensuring that their needs would still be met in the afterlife. Bodies found entombed in bogs across Europe may have been slain as gifts for higher powers. The great civilizations of Mesoamerica killed people, smashed food and sank treasure to pay their debts to their gods.

The ancients could kill you in a million different ways, and give you a million different reasons why it needed to be done. In much of the pre-modern world, ritual sacrifice was framed as necessary for the good of the society at large -- the only way to guarantee, say, a plentiful harvest or success in war.

But the priests and rulers who sanctioned such killings may have had another motive, a new study suggests. An analysis of more than seven dozen Austronesian cultures revealed that the practice of human sacrifices tended to make societies increasingly less egalitarian and eventually gave rise to strict, inherited class systems. In other words, ritual killings helped keep the powerful in power and everyone else in check.

That finding might seem intuitive -- societies in which some members are habitually killed probably value certain lives over others -- but it has broader implications, the researchers said in the journal Nature. It suggests a "darker link between religion and the evolution of modern hierarchical societies," they write, in which "ritual killings helped humans transition from the small egalitarian groups of our ancestors and the large, stratified societies were live in today."

Lots of sociologists have theorised about this connection, the researchers say, but there haven't been many rigorous scientific studies of how it came about until this one.

The scientists behind the Nature study used phylogenetic analysis -- a tool that was originally used to plot evolutionary family trees but can also be applied by sociologists to study the development of languages -- to map the relationships between the 93 cultures they were examining. This allowed them to see whether the traits they were looking for were inherited or adopted from other cultures, and helped determine the causal relationship between human sacrifice and stratification. (The same scientists used the technique last year for a study arguing that belief in supernatural punishment gave rise to political complexity.)

The cultures studied all descended from an ocean voyaging society that originated in Taiwan, but they ranged across the Pacific as far south as New Zealand and as far east as Easter Island. The group was also hugely diverse, including both the small, egalitarian family-based communities of the Isneg in the Philippines and the huge societies of the Hawaiian Islands, which were home to complex states with royal families, slaves, and more than 100,000 people who often came into conflict.

Relying on historical and ethnographic accounts, the researchers rated the cultures according to their level of stratification and identified which ones practiced ritual sacrifice.

The motivation and method of the killings differed across cultures, the researchers explain in a piece for the Conversation: Sacrifices could be demanded for the death of a chief, the construction of a home, the start of a war, the outbreak of disease or the violation of a social taboo. The victims might be strangled, drowned, bludgeoned, burned, buried, crushed with a newly-built canoe or rolled off a roof and then decapitated.

But the link between the sacrifices and social hierarchies seemed to transcend those differences. The victims were almost always of low social status, and the more stratified the culture was, the more prevalent ritual killings were likely to be.

Of the 20 "egalitarian" societies they studied -- so termed because they didn't allow inheritance of wealth and status between generations -- just 25 percent practiced human sacrifice. By contrast, 37 percent of the 46 moderately stratified societies -- where wealth and status could be inherited, but it wasn't necessarily linked to wildly different living standards or pronounced social classes --had the practice. And among the 27 highly stratified cultures, where inherited class differences were strictly enforced with little opportunity for social mobility, a whopping 65 percent committed ritual killings.

The phylogenetic trees illustrated that ritual killings tended to precede social hierarchies, and once stratification occurred, they served to reinforce it. It was very difficult for a culture to return to egalitarianism after class differences had set in.

This finding supports the "social control hypothesis" of human sacrifice, the researchers said. This idea suggests that ritual killings are a way to terrorise people into submission, allowing the religious and political leaders (and in many cultures, those were one and the same) who ordered the killings to consolidate power unopposed.

Speaking to Smithsonian Magazine, lead researcher Joseph Watts noted that ritual killings often occurred in elaborate ceremonies that exploited gore as effectively as an HBO show: "It's not just a matter of killing efficiently. There's more to it than that," he said. "The terror and spectacle [of the act] was maximised."

The fear that sacrifices inspired allowed the practice to function "as a stepping-stone to help build and maintain power in early hierarchical societies," Watts, a psychologist at the University of Auckland, wrote on his website. Once their authority was absolute, elites could use more traditional methods -- policing, taxation, war -- to keep the class system in place.

"People often claim that religion underpins morality," Watts told Science. But he says his study illustrates how religious rituals like human sacrifice are often designed to serve someone other than the gods: "It shows how religion can be exploited by social elites to their own benefit."

This is a pretty grim notion, to be sure. But it may also have been necessary. The division of people into groups of unequal wealth and status was a vital to the development of modern civilization, Watts writes. Hierarchies helped give rise to great cities and vast empires capable of undertaking massive public works projects and creating priceless works of art. Certainly, countless people were oppressed (and, according to this study, killed) in the process. But still, class was critical to getting us to where we are today.

"I think it's absolutely an important project," University of British Columbia psychologist Joseph Henrich told the New Scientist. "Sacrifice does seem to have been performed in societies all around the world."

But he urged some skepticism about the study's broad conclusions. Though human sacrifice may have been correlated with stratification in the Austronesian societies, Henrich was dubious of the phylogenetic analysis the researchers used to prove that the relationship was causal. That tool assumes that social strata and religious rituals are passed down and evolve through generations in the same manner as languages.

"There's no real reason to think that's true -- and in fact there's reason to think it's not true," Henrich told the New Scientist.

For proof, he pointed back at the Austronesian societies Watts and his colleagues studied. Human sacrifice has all but vanished from that region in the past few hundred years, but languages are still being passed down from parent to child -- demonstrating that those two aspects of culture don't necessarily evolve in the same way.

There's also danger in overgeneralising the study's conclusions. What is true of ritual killings in Austronesian cultures may not necessarily apply to the Aztecs or ancient Egyptians. And whatever role human sacrifice may have played in those societies, it's still only one aspect of culture -- it cannot entirely be blamed for the complex hierarchies and rigid class systems that have long dominated much of the modern world.

Nevertheless, religion researchers said they were glad to see rigorous data analysis like the kind used in the Nature study injected into their field.

"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," Richard Sosis, a human behavior ecologist at the University of Connecticut, Storrs, told Science.