The prime suspect in the brutal massacre of 11 members of a Mexican family is an alleged rapist seeking revenge against a victim who landed him in jail.

A law enforcement official told The Associated Press they believe two attackers shot the woman, her family, and other relatives, including two girls.

The killers also slashed a male victim believed to be the woman's partner, and may have tried to decapitate him.

The Puebla state prosecutor's office said that one of the dead women had been raped and had a child by one of the attackers, apparently several years ago.

The killings took place on Thursday night in the remote mountain hamlet of San Jose El Mirador, in the municipality of Coxcatlan in the central state of Puebla.

Clemente Hernandez, a leader of the 50-household village, said two other girls who were wounded were in serious condition, with bullet wounds to the chest and stomach.

Mr Hernandez, 37, said his two daughters, aged eight and nine, were among the dead. He said one of the women who died, also a relative of his, was pregnant.

"We are not going back," he said of the hamlet's residents. "We are going to look for work wherever we can."

Five witnesses survived and were under government protection.

They told the authorities the attackers arrived by foot, opened fire and left. Prosecutors said they are believed to have fled into the mountains of neighbouring Oaxaca state.

Officials had previously raised the possibility that the killings had religious overtones because residents of the largely evangelical hamlet had previously had disputes with Catholics in a nearby community. But that now appears not to have played a role.

The two homes where the killings occurred can be reached only by foot and the bodies had to be carried to the nearest road on stretchers. They were taken to the city of Tehuacan for port-mortem examinations.