The priest threatened to attack the locals with a machete and an axe. (Representational)

A school teacher and his family allegedly tried to sacrifice a three-year-old in their house in Udalguri district of Assam on Saturday, but locals intervened and immediately informed the police and the media.

Some people in Ganakpara village in the district called the police after noticing smoke coming from a house. When they took a closer look of the house, they saw a few members of the family, including women, disrobing themselves while chanting prayers and placing a girl on an altar, the police said.

A priest with a long sword was also spotted standing there and trying to sever the child's head, the locals told the police.

The villagers claimed that when they asked the family to spare the child, the members continued with their chanting and the priest threatened to attack the locals with a machete and an axe.

After the police reached the spot and tried to stop the ritual, the family members started throwing stones and utensils. They even set fire to their motorcycle, car, television set and fridge, the police said.

The police then fired five rounds into the air to bring the situation under control, which injured the a man, later identified as a teacher, and his son. The police then rescued the child.

Eyewitnesses said the child was the daughter of the teacher's sister-in-law and her father had given away the girl to be sacrificed in the presence of her mother.

They also alleged that the priest had been conducting "tantric" rituals in the house since the suicide of a girl there three years ago.

The police have detained the priest and some of the family members.

Investigation into the incident is on, they added.