In a huge blow to gay rights in the world’s largest democracy, India’s top court on Tuesday reinstated an archaic law that makes gay sex a criminal offense on grounds that it can only be dismissed by lawmakers in government.

Saurabh Das / AP Gay rights activists attend a protest meeting after the top Indian court ruled that a colonial-era law criminalizing homosexuality will remain in effect in India in New Delhi, on Dec. 11, 2013.

In a surprise move, India’s top court on Wednesday reversed a landmark judgment by a lower court decriminalizing homosexuality in the country. The court said that the law regarding homosexuality could only be changed by the government. “The legislature must consider deleting this provision (Section 377) from law as per the recommendations of the attorney general,” Justice GS Singhvi, the head of the two-judge Supreme Court bench said in Wednesday’s ruling.

In 2009, the Delhi High Court had overturned an archaic colonial law (section 377 of the Indian Penal Code) that made gay sex an offense punishable by up to life imprisonment. Wednesday’s decision shocked many because while anticipation was high not many expected India’s top court, which in the past upheld many progressive rights judgments often going against the government and popular discourse, to revoke such a forward looking judgment.

“The Supreme Court, by reversing the 2009 Delhi High Court ruling that decriminalized same-sex conduct between consenting adults, failed to recognize everyone’s internationally protected right to privacy and non-discrimination,” said Meenakshi Ganguly, the South Asia director of Human Rights Watch, in a statement. “The Supreme Court’s ruling is a disappointing setback to human dignity.”

The statement urged the Indian government to take a stand and join other Commonwealth states like Australia and New Zealand that have already abolished this colonial law.

Stunned LGBT activists, who have campaigned for decades for acceptance in India’s deeply conservative society, called the decision “retrograde, regressive and revolting.”

“I am thoroughly disgusted and disappointed that the Supreme Court can be party to taking away the rights of a section of the country’s citizens,” Ashok Row Kavi, a veteran LGBT activist told TIME. “India was being looked upon as a model for reform of the anti-sodomy law. This is a huge set back not just for the morale of the LGBT community but also a blow for India’s very successful fight against HIV.”

Decriminalizing homosexuality, the United Nations had told India in 2008, would allow successful intervention programs and help in the fight against HIV/AIDS. India had in fact halved new HIV infections in recent years.

While activists vow to challenge the ruling, the decision to decriminalize homosexuality is now in the hands of New Delhi. And while the good news is that the government has recently changed its position on the issue, arguing for it in the court pointing out that the anti-gay law in the country was archaic and that Indian society has growm more tolerant towards homosexuality, the bad news is that the country is heading for general polls in a few months and a much embattled coalition government is striving hard to retain power. It is thus highly unlikely that gay rights will take center stage in Indian Parliament any time soon.