India's Supreme Court has agreed to re-examine a colonial-era law that criminalises gay sex. Five judges will decide whether Section 377 of the Indian Penal Code, which describes homosexuality as an "unnatural offence" and imposes a 10-year sentence for gay sex, can be overturned. Introduced in 1861, the law says intercourse between members of the same sex is "against the order of nature".

In 2009, a New Delhi High Court declared Section 377 unconstitutional, but the judgment was overturned four years later when the Supreme Court decided that amending or repealing the law should be left to Parliament, not the judiciary. That decision ended a four-year period of decriminalisation that helped bring homosexuality into the open. India's parliament did not act on the matter, with the ruling Hindu nationalist party in no hurry to change the law.

While the previous Congress-led government had pledged to repeal the law if it came to power again, it was crushed by Prime Minister Narendra Modi's Bharatiya Janata Party in general elections in May 2014.

In December, members of Modi's party, which has an overwhelming majority in the lower house of parliament, scuppered a private member's bill to scrap the law. Human rights group Amnesty International India welcomed the court's review, saying the law puts homosexuals under physical, mental and legal threat. "The Supreme Court has another chance to correct a grave error," Amnesty said.

Gay activists cheered the court decision and said they were hopeful that the verdict would ultimately go in their favour, giving them a chance to live openly.

India is one of 75 countries around the world that outlaws homosexuality, according to the International Lesbian, Gay, Bisexual, Trans and Intersex Association. Although the law banning homosexuality is rarely enforced in India, activists say it is used to intimidate, harass, blackmail and extort money from homosexuals. There are no official figures on the number of cases and most go unreported as victims are too scared to report crimes to the police, fearing they will be punished too, according to activists.

Over the past decade, homosexuals have gained a degree of acceptance in parts of deeply conservative India, especially in big cities. Many bars have gay nights, and some high-profile Bollywood films have dealt with gay issues. Still, being gay is seen as shameful in most of the country, and many homosexuals remain hidden. National surveys show about three-quarters of Indians disapprove of homosexuality and are deeply traditional about other issues of sexuality such as sex outside of marriage.