Nearly 30 Muslims have been killed and houses burned in the worst outbreak of ethnic violence in the remote north-eastern region of India in two years, officials have said.

Police arrested 22 people after authorities called in the army to restore order in Assam state and imposed an indefinite curfew in the wake of the 29 deaths. They have been blamed on rebels from the Bodo ethnic group, who have long accused Muslim residents of coming into India illegally from neighbouring Bangladesh.

A state minister for border areas, Siddique Ahmed, said after visiting the affected areas that his government and the ruling Congress party had failed to protect the victims, who included at least eight women and as many children.

"Even two-year-old children who could barely walk have been shot dead. I have never witnessed such scenes in my life," he told reporters.

Police said they had arrested 22 people who allegedly burned homes or provided shelter to the insurgents, according to the regional police inspector general, LR Bishnoi.

He said the rebels belong to a faction of the National Democratic Front of Bodoland, which has been fighting for a separate homeland for the ethnic Bodo people for decades. The Bodos are an indigenous group in Assam, making up 10% of the state's 33 million people.

However, in an email to reporters on Saturday the rebel faction denied the charge and blamed the killings on the state government.

The violence came at a time of heightened security during India's general election, with voting taking place over six weeks. Tensions have been high since a Bodo politician in India's parliament criticised Muslims for not voting for the Bodo candidate, said Lafikul Islam Ahmed, leader of a Muslim youth organisation called the All Bodoland Muslim Students' Union.

Local television reports showed hundreds of Muslim villagers fleeing their homes with belongings on pushcarts or in their hands. Most were headed to nearby Dubri district, which is near the border with Bangladesh. Nearly 400 people had fled so far, Bishnoi said.

In 2012, violence between Bodo people and Muslims killed as many as 100 people in the same area.

Police said that in the third and most recent attack on Friday evening, militants entered a village in the western Baksa district and set at least 40 Muslim homes on fire before opening fire. Assam's additional director general of police, RM Singh, said 11 bodies, all of them shot to death, were recovered from the attack. Another seven bodies were recovered on Saturday, Bishnoi said.

The first attack took place in the same district late on Thursday night when at least eight rebels opened fire on a group of villagers sitting in a courtyard. Four people were killed and two were wounded, police said. The second attack happened around midnight in Kokrajhar district when more than 20 armed and hooded men broke open the doors of two homes and opened fire, killing seven people, witnesses said.

Mohammed Sheikh Ali, 28, said his mother, wife and daughter were killed in the attack.

"I will curse myself forever because I failed to save them," Ali said in a telephone interview from a hospital where he was waiting for doctors to complete the postmortem examinations on his family. "I am left all alone in this world … I want justice."