INDIA’S government on Wednesday asked the country’s top court to rule on whether to repeal or keep a controversial law that criminalises homosexual acts.

Section 377 of the penal code, a relic from 1860s British legislation, bans gay acts as “carnal intercourse against the order of nature” and allows for jail terms of up to life, although prosecutions are rare.

Government lawyer Tushar Mehta asked the court to rule on the issue of consensual sexual acts between two adults.

He urged the five justices not to widen the scope of the court decision to issues like gay marriages, adoption and inheritance.

The Supreme Court is hearing petitions by activists challenging the law that makes gay sex punishable by up to 10 years in prison.

“We leave to the wisdom of the court to deal with the validity of Section 377 (of the penal code) so far as it relates to consensual sexual acts between two adults,” the Press Trust of India news agency quoted Mehta as telling the five justices hearing the issue.

The judges said the court would test the validity of the law in relation to consensual sexual acts between two adults.

In 2009 the Delhi High Court effectively decriminalised gay sex, saying a ban violated fundamental rights, but the Supreme Court reinstated it in 2013 after religious groups successfully appealed.

The Supreme Court said the High Court had overstepped its authority and that the responsibility for changing the law rested with politicians not the courts. Efforts to introduce legislation however came to nothing.

In January this year however, the Supreme Court agreed to hear a challenge by a clutch of high-profile Indians who said the law created an atmosphere of fear and intimidation in the world’s largest democracy.

A ruling was not expected imminently, with Tripti Tandon, a lawyer for one of the petitioners in the case, saying the hearing would last “two weeks if not more”.

Her client, Aris Jafer, was arrested and sent to prison for 50 days in 2001.

Manvendra Singh Gohil, an openly gay Indian prince who is an ambassador for the AIDS Healthcare Foundation charity, said on Tuesday he hoped the “draconian” law would be changed.

“The law doesn’t affect only the gay community,” he told AFP. “In fact it violates the fundamental right of every Indian.”

“(If) this law continues it would mean we are still slaves of the British.”

The gay community was emboldened last year when the Supreme Court referred explicitly to the issue in a landmark ruling upholding the right to privacy.

Gay sex has long been taboo in conservative India, particularly in rural areas where nearly 70 per cent of people live, with homophobia widespread. Some still regard homosexuality as a mental illness.

Hindu right-wing groups supportive of Prime Minister Narendra Modi’s ruling Bharatiya Janata Party (BJP) have been especially vocal, calling gay relationships a disease and a Western cultural import.

Last month, a lesbian couple committed suicide by jumping into a river in the western state of Gujarat, in just the latest tragedy as gay men and women struggle to conform to societal norms.

According to official data, 2,187 cases under Section 377 were registered in 2016 under unnatural offences. Seven people were convicted and 16 acquitted.

Globally 72 countries criminalise same-sex relationships, according to a 2017 report by the International Lesbian, Gay, Bisexual, Trans and Intersex Association.

Over the past decade, homosexuals have gained a degree of acceptance in 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 largely seen as shameful in most of the country, and many homosexuals remain closeted.