India's Supreme Court has agreed to reexamine a colonial era law which outlawed sex between men, in a possible breakthrough for gay rights in the country.

The court said it would reexamine the validity of Section 377 of the Indian penal code which bans “carnal intercourse against the order of nature with any man, woman or animal” which is punishable by life imprisonment and has widely been interpreted as a law against gay sex.

It is adapted from an 16th century English law and was adopted when India was a colony of the British Empire.

The court agreed to refer the question of its validity to a large bench for examination before October.

They were responding to a case brought by LGBT rights activists who said the ban put them at constant threat of arrest.

One of the justices said: “A section of people or individuals who exercise their choice should never remain in a state of fear.

“Choice can’t be allowed to cross boundaries of law, but confines of law can’t trample or curtail the inherent right embedded in an individual under article 21 of [the] constitution.”

The decision comes after the court ruled that India’s LGBT community had a fundamental right to express their sexuality in August.

The judges ruled that sexual orientation is covered under clauses in the Indian Constitution that relate to liberty even though the Indian government insisted there is no legal right to privacy.

Campaigners thought the ruling would pave the way for the repeal of Section 377.

LGBT+ rights around the globe Show all 9 1 /9 LGBT+ rights around the globe LGBT+ rights around the globe Russia Russia’s antipathy towards homosexuality has been well established following the efforts of human rights campaigners. However, while it is legal to be homosexual, LGBT couples are offered no protections from discrimination. They are also actively discriminated against by a 2013 law criminalising LGBT “propaganda” allowing the arrest of numerous Russian LGBT activists. AFP/Getty LGBT+ rights around the globe Brunei Brunei recently introduced a law to make sodomy punishable by stoning to death. It was already illegal and punishable by up to 10 years in prison AFP/Getty LGBT+ rights around the globe Mauritania Men who are found having sex with other men face stoning, while lesbians can be imprisoned, under Sharia law. However, the state has reportedly not executed anyone for this ‘crime’ since 1987 Alamy LGBT+ rights around the globe Sudan Both male and female same-sex sexual activity is illegal under Sudanese law. Men can be executed on their third offence, women on their fourth Getty LGBT+ rights around the globe Saudi Arabia Homosexuality and gender realignment is illegal and punishable by death, imprisonment, whipping and chemical castration Getty LGBT+ rights around the globe Yemen The official position within the country is that there are no gays. LGBT inviduals, if discovered by the government, are likely to face intense pressure. Punishments range from flogging to the death penalty Getty LGBT+ rights around the globe Nigeria Both male and female same-sex sexual activity is illegal and in some northern states punishable with death by stoning. This is not a policy enacted across the entire country, although there is a prevalent anti-LGBT agenda pushed by the government. In 2007 a Pew survey established that 97% of the population felt that homosexuality should not be accepted. It is punishable by 14 years in prison Reuters LGBT+ rights around the globe Somalia Homosexuality was established as a crime in 1888 and under new Somali Penal Code established in 1973 homosexual sex can be punishable by three years in prison. A person can be put to death for being a homosexual Reuters LGBT+ rights around the globe Iraq Although same-sex relationships have been decriminalised, much of the population still suffer from intense discrimination. Additionally, in some of the country over-run by the extremist organisation Isis, LGBT individuals can face death by stoning Getty

Section 377 was dismissed by the High Court in Delhi in 2009 but this ruling was later overruled by the Supreme Court in 2013 which said it was the responsibility of Parliament, not the judiciary, to change the law.

The law is rarely informed when it comes to homosexuality – the Supreme Court observed few than 200 people had been convicted of homosexual acts under the legislation in 2013 in a country of 1.3bn people – but campaigners say the act still gives people the power to blackmail LGBT people and hampers efforts to combat HIV/Aids.

Some 1,347 cases were recorded under Section 377 in 2015 but most of these were related to alleged sexual offences against children.

LGBT activist Aditya Bondyopadhyay said the decision showed the court was reconsidering its earlier decision to uphold and was trying to correct it.

He said: “There has been so much criticism of the judgment, and mobilisation on the ground and acceptance levels have gone up by a lot, [despite] the conservative forces in the ruling party”.

India remains a conservative society and there appears to be little political appetite to change the law.

The ruling Bharatiya Janata, headed by Prime Minister Narendra Modi, is seen as hostile to LGBT rights and runs on a platform of Hindu nationalism which stresses the importance of traditional Indian masculinity.

But there are signs the country is changing as Congress, the main opposition party which ruled the country until 2014, has put the issue in its election manifesto.