DIBYANGSHU SARKAR/AFP/Getty Images

India still has a long way to go on LGBT rights.

The country’s Supreme Court today struck down a British-era law from 1861 that criminalized gay sex. “Consensual sex between adults in the private space, which is not harmful to women or children, cannot be denied as it is a matter of individual choice,” the court wrote in a unanimous opinion. “The law had become a weapon for harassment for the LGBT community,” said chief justice Dipak Misra. “Any discrimination on the basis of sexuality amounts to a violation of fundamental rights.” India is now one of more than 120 countries where homosexuality is decriminalized.

Politicians were divided over the ruling. The governing Bharatiya Janata Party has said it would respect the court’s decision, but BJP Member of Parliament Subramanian Swamy criticized the ruling, saying that it “could give rise to an increase in the number of HIV cases” and that homosexuality is “a genetic flaw like having six fingers on your hand.” The main opposition party, the Congress Party, tweeted that they “hope this is the beginning of a more equal and inclusive society.”

According to a poll from 2016, 40 percent of Indians agreed at least in part that private consensual same-sex relationships should not be allowed, and 71 percent said they would be somewhat or very upset if one of their children was in love with someone of the same sex. This enduring resistance to gay couples is indicative of the challenges facing Indians seeking equal rights for LGBT people, including legalized gay marriage. According to the same 2016 poll, 35 percent of Indians said same-sex marriage should not be legal, and another 30 percent were unsure.

The court explicitly said that its ruling only concerned the constitutional validity of the 1861 law and not other rights, such as those related to marriage or inheritance.