NEW DELHI (AP) — India's top court ordered Wednesday that five prominent rights activists arrested for alleged Maoist links be kept under house arrest instead of police custody until it rules next week on a petition challenging their detention.

Police, meanwhile, broke up a protest in southern India against the arrests and detained about two dozen people.

Attorney Prashant Bhushan said the court order will prevent police from taking the five to the western city of Pune, where authorities are investigating their alleged links to Maoist rebels in various parts of the country.

The Supreme Court also ordered the federal and state governments to provide detailed reasons for their arrests by Sept. 5. It set Sept. 6 for the next hearing in the case.

Those arrested on Tuesday were Telugu-language poet Varavara Rao in Hyderabad, Vernon Gonzalves and Arun Farreira in Mumbai, and Gautam Navalakha and Sudha Bhardwaj in New Delhi and a neighbouring town.

Police accused the five of delivering speeches that triggered protests and violence between low-caste Dalits and right-wing groups near Pune in December.

The justices asked prosecutors why the police have taken eight months after the incident to arrest the five activists. They said the activists were reputed citizens and stifling the dissent was not good.

"Dissent is the safety valve of democracy and if you don't allow these safety valves, it will burst," the Press Trust of India news agency quoted Chief Justice Dipak Mishra and Justices A.M. Khanwilkar and D.Y. Chandrachud as saying during court proceedings.

The government says Maoist rebels, who are active in several states, are India's biggest internal security threat. The rebels, inspired by Chinese revolutionary leader Mao Zedong, have been fighting the government for more than four decades, demanding land and jobs for the poor and indigenous communities.

Participants in the protest Wednesday in Hyderabad in southern India chanted slogans against the arrests, calling them a violation of fundamental rights. Police broke up the demonstration and forced the protesters into police buses and drove them away.

The arrests of the five activists were condemned by Amnesty International, which said they have worked to protect the rights of some of India's most poor and marginalized people.

In June, police arrested five other activists on suspicion of also inciting the Dalits, who have been marginalized for centuries and forced to perform jobs considered unacceptable by other castes.

Caste prejudice is endemic in Hindu-majority India, even though the constitution outlaws the practice and has made it a crime punishable by up to a year in prison.