Investigators discovered the bodies in a mass grave after locals alerted authorities last weekend about several families being held against their will by a religious sect called The New Light of God.
The sect had been performing rituals and exorcisms inside a makeshift “church” in a remote area about 250km from Panama City.
A freshly dug grave was found about a mile from the church building and contained the bodies of five children as young as a year old, their pregnant mother, and a 17-year-old female neighbour.
The survivors suffered bodily injuries after being tied up and beaten with wooden cudgels and Bibles, burned, and hacked with machetes.
Senior prosecutor Rafael Baloyes said: “They searched this family out to hold a ritual and they massacred them, mistreated them, killed practically the whole family.
"They were performing a ritual inside the structure. In that ritual, there were people being held against their will, being mistreated.
“All of these rites were aimed at killing them, if they did not repent their sins.”
He added they found a naked woman, alongside machetes, knives and a ritually sacrificed goat inside the building.
The rituals had been ongoing since Saturday when one of the members had a vision that “God had given them a message”, said Mr Baloyes.
Ten people have been arrested on suspicion of murder, including the grandfather of the dead children and a minor, and charged with deprivation of liberty, homicide and sexual abuse, reported the New York Times.
A hearing will be held on Friday, said the Public Ministry of Panama.
Ngabe Bugle zone leader Ricardo Miranda called the sect “satanic” and said it went against the region’s Christian beliefs.
He said: "We demand the immediate eradication of this satanic sect, which violates all the practices of spirituality and co-existence in the Holy Scriptures."
The sect had been operating locally for about three months and its beliefs and affiliations were not known.
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.
Additional reporting by agencies