Irom Sharmila, 42, started her hunger strike in 2000 after 10 civilians were killed in a shooting blamed on the army in Manipur state.
Sharmila -- also known as the "Iron lady of Manipur" -- has demanded the repeal of India's Armed Forces (Special Powers) Act (AFSPA) because it gives sweeping powers to the military to search properties, detain suspects without warrants and shoot on sight.
Since 2000, Sharmila has been arrested 14 times for trying to kill herself, prompting authorities to force feed her under a law that makes attempted suicide illegal, her counsel Khaidem Mani told CNN.
But Mani challenged the attempted suicide charge, citing the country's history of hunger strikes. Mahatma Gandhi used the same mode of protest during the nation's independence struggle, he told the sessions court in Imphal East, a district of Manipur.
"I also argued that a hunger strike was no crime," he said.
The magistrate ruled there was insufficient evidence to prove she was attempting to commit suicide. In doing so, he overturned a lower court's attempt to put her on trial for attempted suicide.
After the court ordered her release, Sharmila resumed her hunger strike, her lawyer added.
Misuse of powers
Last year, India's Vice President Hamid Ansari admitted there had been "serious complaints of misuse of the AFSPA."
"This reflects poorly on the state and its agents," a statement from his office said.
Meantime, Amnesty International called Sharmila's arrests "farcical," saying she should not be taken into custody again.
"The judgment must end the farcical cycle of arrest and re-arrest that this brave activist has faced for so long. Authorities must not detain Irom Sharmila again but engage with the issues she is raising," said Shemeer Babu, the rights group's program director in India.
Activists and non-profit organizations have repeatedly urged the Indian government to scrap the AFSPA.
In 2005, a government-appointed committee recommended the law be abolished. Its recommendations remain under the government's "consideration," India's Deputy Home Minister Kiren Rijiju told the national parliament last month.
Manipur is an impoverished, landlocked state in India's remote northeastern belt. For years, many Manipuri tribal communities have resisted the authority of Delhi, claiming that they have suffered neglect from the central government.
This disaffection has given rise to occasional outbreaks of violence.