Seven people were killed in a bizarre religious ritual in a jungle community in Panama, in which indigenous residents were rounded up by about 10 lay preachers and tortured, beaten, burned and hacked with machetes to make them “repent their sins”. Ten people were arrested.

Police freed 14 members of the Ngabé Buglé indigenous group who had been tied up and beaten with wooden cudgels and Bibles.

On Thursday, the local prosecutor Rafael Baloyes described the chilling scene that investigators found when they made their way through the jungle-clad hills to the remote Ngabé Buglé indigenous community near the Caribbean coast on Tuesday.

Alerted by three villagers who escaped and made their way to a local hospital for treatment earlier, police were prepared for something bad, but were still surprised by what they found at an improvised church at a ranch, where a little-known religious sect known as “The New Light of God” was operating.

“They were performing a ritual inside the structure. In that ritual, there were people being held against their will, being mistreated,” Baloyes said.

“All of these rites were aimed at killing them, if they did not repent their sins,” he said. “There was a naked person, a woman” inside the building, where investigators found machetes, knives and a ritually sacrificed goat.

The rites had been going on since Saturday, and had already resulted in deaths.

About a mile (2km) away from the church building, authorities found a freshly dug grave with the corpses of six children and one adult. The dead included five children as young as a year old, their pregnant mother and a 17-year-old female neighbor.

“They searched this family out to hold a ritual and they massacred them, mistreated them, killed practically the whole family,” said Baloyes, adding that one of the suspects in the killing is the grandfather of the children who were slain.

The sect had reportedly only been operating in the area for about three months.

But things came to a head on Saturday, when one of the church members had a vision.

“One of them said God had given them a message,” Baloyes said. “That message apparently boiled down to making everyone repent or die.”

The Ngabé Buglé are Panama’s largest indigenous group, and suffer from high rates of poverty and illiteracy.

It was not clear what belief or affiliations the New Light of God church has. A well-established evangelical church known as Luz del Mundo said in a press statement that it had no ties to the case.

The area is so remote that helicopters had to be used to ferry the injured out to hospitals for treatment. They included at least two pregnant women and some children.