Five prominent human rights activists have been placed under house arrest for alleged links to Maoist insurgents, drawing accusations the Narendra Modi government is moving to silence critics in the run-up to next year’s national elections in India.

The five were arrested in simultaneous raids across India on Tuesday as part of an investigation into a march in December by low-caste Dalit groups that was attacked by rightwing Hindu activists and escalated into full-blown riots that shut down parts of Mumbai.

The arrests sparked protests in Delhi and Mumbai and were condemned by prominent writers and activists. “This is absolutely chilling,” tweeted the historian Ramachandra Guha. “The supreme court must intervene to stop this persecution and harassment of independent voices.”

Arundhati Roy, the Booker prize-winning author, said: “It is in preparation for the coming elections. It is as close to a declaration of an emergency as we are going to get.”

The supreme court on Wednesday ordered the group be released from police custody and into house arrest until the police could present evidence.

Vrinda Grover, the lawyer who represented the group in the supreme court on Wednesday, said the decision to put them under house arrest showed the court recognised “the larger issue at risk here, which is the threat to fundamental freedoms”.

One judge, DY Chandrachud, reportedly remarked during the hearing: “Dissent is the safety valve of democracy. If dissent is not allowed then the pressure cooker may burst.”

Grover added: “These are well-known human rights defenders who have an ideological position which is at variance with the state, they espouse the cause of the weak and marginalised.”

Activists protest against the arrests in New Delhi. Photograph: Harish Tyagi/EPA

Police seized laptops and mobile phones and asked for passwords from Sudha Bharadwaj, a trade unionist and law professor who was among those arrested.

The US-born Bharadwaj, 56, has spent years working on political campaigns with marginalised tribal communities in Chhattisgarh, work that has often pitted her against the government and mining interests in the mineral-rich state.

“The effort is whatever is the opposition to this regime, whether it is workers’ rights, tribal rights, everybody who in the opposition is being rounded up,” she told reporters outside her home in Faridabad, a short distance from Delhi.

The others arrested were Varavara Rao, a prominent poet from the southern city of Hyderabad, the activists Vernon Gonsalves and Arun Ferreira from Mumbai, and Gautam Navlakha, a civil liberties activist from Delhi.

“The accused are booked under the unlawful activities prevention act,” a police officer in the western city of Pune told Reuters.

He said the group were involved in making provocative speeches before the Dalit rally on 31 December last year. The event commemorated a 200-year-old battle in which low-caste Indians joined forces with the colonial British army to defeat a Hindu ruler, whom the Dalits accused of mistreating them.

The Dalit protests that followed the attacks on the march in December were considered politically sensitive for India’s Hindu nationalist government, which aims to unite all Hindus under one political banner.

The five arrested all work with marginalised low-caste and tribal groups, supporters of whom are often accused of links to militant Maoist groups who have been fighting an insurgency inside India for more than half a century.

A report submitted to the government the Pune police claimed the group belong to various organisations “with linkages to the Communist Party of India [Maoists]”.

Rahul Gandhi, the leader of the main opposition Congress party, said the raids showed that the government had little tolerance for dissenting voices.

“Shut down all other NGOs. Jail all activists and shoot those that complain. Welcome to the new India,” he tweeted.