MEXICO CITY — The bodies of six children and a pregnant woman were found in a freshly dug grave in a remote, predominantly indigenous community on the Caribbean coast of Panama, possibly the sacrificial victims of a ritual performed by a religious sect, the Panamanian authorities said Thursday.

The victims had been kidnapped from their homes by other members of the community, beaten and killed, said Rafael Baloyes, the chief prosecutor for the province of Bocas del Toro.

The woman was the mother of five of the children; the sixth child was a neighbor, Mr. Baloyes said. The children ranged in age from 1 to 17.

The authorities raided the community, Alto Terrón, on Wednesday after receiving a tip that people were being abused there, the prosecutor said, adding that officials saw a post on social media about someone being burned.