Politicians have been banned from entering a district in the north of India after political parties were blamed for fomenting a wave of sectarian rioting in which dozens of people have died.

At least 31 people were killed in clashes between Hindus and Muslims around the town of Muzaffarnagar in the vast and poor Uttar Pradesh state. Many more remain missing and hundreds have been forced to leave their homes.

Police arrested more than 90 people after violence spread to the further districts on Sunday night. Despite the deployment of troops, tensions have remained high on Monday.

Shops and schools were closed and soldiers searched houses for weapons in Muzaffarnagar, which is about 78 miles (125km) north of Delhi.

Uttar Pradesh has a long history of sectarian violence, and although tensions have eased in recent years, many are now nervous that rival political groups will seek to exploit communal tensions to build support in advance of general elections scheduled for next spring.

Four local politicians from the Hindu nationalist Bharatiya Janata party (BJP) and one from the ruling Congress party have been named in a police charge sheet for inciting the recent violence.

Several others – including a national cabinet minister and a senior opposition leader – tried to reach Muzaffarnagar on Monday but were detained by police who said their presence could stir up more violence.

The district magistrate in Muzaffarnagar has said no politicians will be allowed to visit areas of violence. Administrators in India have wide-ranging powers to impose curfews or take other measures they deem necessary to preserving calm.

Professor Sudha Pai, an expert on Uttar Pradesh politics at the Jawaharlal Nehru University, said the communities in Muzaffarnagar involved in the weekend violence did not have a history of tension.

Pai told Reuters: “On the whole, these communities have lived side by side. This has been fomented. There is no doubt about it.”

Voting in polls in India is often determined along caste or sectarian lines, with ideology playing, at best, a minor role.

Analysts say the Samajwadi party (SP), in power in the state since 2012, may be hoping communal tensions will consolidate its own support, particularly among Uttar Pradesh’s large Muslim population.

The BJP, they suggest, is hoping to build popularity among Hindus in Uttar Pradesh, particularly from castes at “intermediate” levels in India’s tenacious social hierarchy.

The immediate cause of this weekend’s violence appears to be the killings of three men following an incident involving the sexual harassment of a Hindu teenage girl. According to one account the brothers of the girl killed her persecutor but were then killed themselves by “members of his community”.

Sexual harassment of women is widespread in rural villages in Uttar Pradesh and often leads to feuds and violence.

Rioting began in earnest on Saturday night after a meeting of thousands of Hindu farmers called for justice following the deaths. Officials said some of the farmers had given hate-filled speeches against Muslims at the meeting.

Clashes with Muslims broke out after the meeting, with many people carrying guns, swords and knives, said a senior police officer, Arun Kumar.

Other officials told local journalists that the violence had appeared well-planned with attackers using “guerilla tactics” and showing “deep local knowledge” as they took on security forces and threw petrol bombs into houses.

Rumours spread by mobile phones, and social media fuelled the violence, mading it difficult for soldiers to restore calm, state police inspector Ashish Gupta said.

Uttar Pradesh has a population of nearly 200 million and socioeconomic indicators worse than many parts of sub-Saharan Africa.

The 1992 razing of a 16th-century mosque by a Hindu mob in the city of Ayodhya in the state sparked India’s bloodiest sectarian clashes for decades.

Sushilkumar Shinde, the Indian home minister, said that 451 incidents had been reported to date this year in Uttar Pradesh, compared with 410 throughout 2012.

Shinde said that local authorities had been warned of heightened risk of communal violence in Uttar Pradesh as national elections drew nearer.

“As elections are approaching, I had already assessed that there would increase in communal tension in the country … We have information that some people will try to create disturbances,” the minister told local broadcaster CNN-IBN.

Uttar Pradesh is seen as a bellwether state, sending 80 representatives to the lower house of parliament, almost a seventh of the total.

The SP won state elections in 2012 and will hope to garner sufficient national seats in Uttar Pradesh in the coming general elections to negotiate from a position of strength when a coalition government is formed.

The maverick populist politician Mayawati, whose Bahujan Samaj party (BSP) lost to the SP in 2012 amid allegations of incompetence and corruption, claimed “the [BJP and the SP] want to create communal tension in the run up to the polls”.

“Both parties are together in this and trying to play dirty politics,” Mayawati said.

This article first appeared on The Guardian