A placard is pictured during a protest by members and supporters of the lesbian, gay, bisexual and transgender (LGBT) community in New Delhi on January 31, 2016. India's apex court will hear a curative petition on February 2 against its December 2013 ruling which validated provisions of Section 377 of Indian Penal Code (IPC), a British era law which deems sex between adults of the same sex a criminal offense. The colonial era rule which carries a punishment of 10 years in prison was struck down by Delhi High Court in a landmark judgment in 2009 before the top court reversed its verdict. AFP PHOTO / SAJJAD HUSSAIN / AFP / SAJJAD HUSSAIN (Photo credit should read SAJJAD HUSSAIN/AFP/Getty Images)

India’s Supreme Court has ruled that gay people have a right to live in private, putting the future of the country’s anti-gay law in doubt.

Homosexuality is illegal in India under Section 377 of the penal code, which is based on outdated British colonial law.

The century-old law was brought back into effect by a court ruling in 2013, outlawing “carnal intercourse against the order of nature”.

However, a separate ruling this week from the country’s Supreme Court has affirmed that gay people should be afforded basic rights.

The ruling, which was on an unrelated privacy case, appeared to affirm that LGBT people deserve basic right to live, ahead of a wider challenge to Section 377.

The nine-judge court affirmed: “Sexual orientation is an essential attribute of privacy.

“Discrimination against an individual on the basis of sexual orientation is deeply offensive to the dignity and self-worth of the individual.”

Equality demands that the sexual orientation of each individual in society must be protected on an even platform.

“The right to privacy and the protection of sexual orientation lie at the core of the fundamental rights guarunteed by [the Constituion].”

The decision also challenged the ruling that reinstated Section 377, which had initially said that the law was not discriminatory because it only impacted a “minuscule fraction of the country’s population”.

The Supreme Court ruled this week: “That ‘a miniscule fraction of the country’s population constitutes lesbians, gays, bisexuals or transgenders’ is not a sustainable basis to deny the right to privacy.

“The purpose of elevating certain rights to the stature of guaranteed fundamental rights is to insulate their exercise from the disdain of majorities, whether legislative or popular.

“The guarantee of constitutional rights does not depend upon their exercise being favourably regarded by majoritarian opinion. The test of popular acceptance does not furnish a valid basis to disregard rights which are conferred with the sanctity of constitutional protection.

“Discrete and insular minorities face grave dangers of discrimination for the simple reason that their views, beliefs or way of life does not accord with the ‘mainstream’.

“Yet in a democratic Constitution founded on the rule of law, their rights are as sacred as those conferred on other citizens to protect their freedoms and liberties.”

Prime Minister Narendra Modi’s Hindu nationalist Bharatiya Janata Party MPs have consistently resisted bids to repeal the law through Parliament, and last year a private members’ bill on the issue was voted down.

Modi’s Home Secretary Rajnath Singh insisted previously: “We support Section 377 because we believe that homosexuality is [an] unnatural act that cannot be supported.”

Shocking statistics last year had showed that hundreds of men were being arrested under the reinstated anti-gay law, raising fears of a homophobic purge.

There have been 1,491 arrests in 2015 under Section 377.

Nearly all of those arrested were men, though 207 minors and 16 women among those arrested under the law.