People living at the La Quemada archaeological site 1,500 years ago would eat their enemies then hang up their bones for display.

A study published in the journal Proceedings of the National Academy of Sciences analysed human bones found at the Mexican site that was occupied between 500AD and 900AD.

Bones at several different areas had been processed for display, with signs of disarticulation and defleshing – for what purpose this was, though, remained a mystery.

By looking at the differing cut marks and treatment of the bones, scientists have said the differing locations of the remains likely points to what their role was in the society at the time.

Those found indoors tended to have been treated with greater respect, suggesting the purpose as ancestor veneration rather than a vanquished enemy. The remains found outdoors, on the other hand, appear to be those of adversaries.

Researchers said there appear to be several different cultural contexts for their use. "First, three clusters of human remains in the temple represent all ages and adult males and females. These are primarily whole long bones with shallow cut marks, suggesting defleshing after some period of post-mortem desiccation and decay. This arrangement suggests ancestor veneration," they wrote.

The next set of bones, found outdoors, shows signs of cut marks, bone splinters and burning: "This area was likely a place for public feasting and anthropophagy. The Patio B bones had pot polishing and other characteristics consistent with cannibalism."

Another site had processed bones with drilled crania, suggesting these were defeated enemies that had been put on public display outside the wall of the temple.

The period the bones date to was that of rapid and social demographic change, the authors note. It followed the collapse of the Teotihuacan city and new smaller-scale societies formed across the Northern Frontier.

Authors Ben Nelsona and Debra Martin believe there was a huge amount of social violence at the time, with the architecture at La Quemada showing defensive buildings: "The builders augmented natural cliffs with thick enclosing walls; they placed buildings on terraces with steep walls and narrow access from below, disadvantaging attackers."

Concluding, the authors said: "Were the human bones... those of ancestors or enemies? The present study concludes 'both'. The residents of La Quemada treated the bones as animated, powerful objects, constituting two basic categories of social persons: ancestors and adversaries."

They said the practices seen at the site fit in with a "widespread pattern of persistent interethnic violence", with enemy skeletal displays being symbolically important in recalling past episodes of conflict.

They added: "The historical evidence suggests that the enemies are likely to have been ethnic others, yet evidence from modern zones of persistent conflict shows that ethnic diversity does not predict frequency of conflict.

"To follow up on the conclusion that the violence was interethnic, the obvious next steps are stable isotopic and DNA analyses of skeletal samples from the identified contexts. If the inferences are correct, those analyses should corroborate the contrasts presented here with indications of biological distance."