A lawyer representing the government of India has said it “does not matter” that the country’s health minister supports the decriminalisation of gay sex.

The government is opposing a petition filed by gay rights activists asking the Delhi High Court to overturn the law on homosexual acts between consenting adults.

Debate about Section 377 of the Indian Penal Code, the 148 year old law that criminalises gay sex, has been long and heated.

The law bans “unnatural sex” and theoretically punishes anyone who engages in anal or oral sex with up to ten years in prison:

“Whoever voluntarily has carnal intercourse against the order of nature with another person of the same sex shall be punished with imprisonment which may extend to ten years, and shall also be liable to fine,” it states.

The home department has argued that Section 377 should be retained, and last week the law ministry agreed, brushing aside the health department’s assertion that repeal would help the fight against HIV infection.

India has the greatest number of HIV/AIDS patients in the world, an estimated 2.5 million.

Section 377 is “not merely confined to gay rights, it acts as a deterrent against those with sick minds too,” the law ministry said.

At Delhi High Court today, assistant solicitor general P P Malhotra said: “it doesn’t matter what the minister says. It is for the court to decide the issue.”

Health Minister Anbumani Ramadoss today defended his support for decrminalisation.

“I would like to help gays come overground for an effective fight against AIDS,” he said in an IANS interview.

“The world over gays are being accepted. We too need to move on.

“Imagine the problem this (Section 377) means when it comes to our fight to contain HIV infection.

“While I fully support protecting children against sexual abuse and treating pedophiles as criminals, I would like to help gays come overground for an effective fight against AIDS.”

The 39-year-old Tamil doctor is the youngest member of Prime Minister Manmohan Singh’s Cabinet and is tipped as a future leader.

Section 377 was enacted in 1860 under the British Raj in line with the anti-sodomy laws in England at the time.

In June more than a thousand people took to the streets of three major Indian cities to celebrate Pride.

The largest turnout was in Bangalore, where 600 people marched.

An estimated 300 LGBT people took part in New Delhi’s first ever Pride parade, while 400 marched in Kolkata.