For journalist Sunil Mehra, sitting in the Indian supreme court on Wednesday was a “heart-wrenching” moment he will never forget. He fought back tears as the story of his love for his partner, classical dancer Navtej Johar, was recounted by their lawyer Menaka Guruswamy to the five judges who are deciding whether India should legalise gay sex.

Guruswamy said the two men had loved each other for 24 years, that Mehra had passed a tough exam to join the civil service but did not dare join over fears that his homosexuality would become known. He added that every decision they took was under threat of persecution, that they were never able fully to be themselves and that they were living, in effect, as unconvicted felons.

Referring to the fact that under Indian law dating back to 1861 their sex life is a crime punishable by a 10-year prison sentence, Guruswamy said: “Twenty years of their lives have gone. In fear of persecution. They have been forced to live insecure, vulnerable lives. Can we at least ensure that those who are younger have a better life?”

The hearing was the third day of the supreme court’s deliberations on petitions filed by Mehra, Johar and others arguing that India should scrap a law criminalising gay sex between consenting adults.

On Wednesday, the 20-year-old legal battle to legalise gay sex received a boost when the government told judges that the decision was up to them and it will not contest the petitions.

The decision is significant given that the ruling Bharatiya Janata party upholds a conservative Hindu cultural ethos in which traditional values are paramount. This development greatly increases the probability that the court will move to abolish the law.

Even before this move, the court seemed likely to rule in favour of legalising sex between consenting adults. Last year, it gave a landmark ruling that guaranteed the constitutional right to privacy, saying that a person’s sexual orientation was “an essential attribute of privacy”. This, many lawyers said, laid the path for the court to abolish the law.

Lawyers have been deploying every possible weapon in their arsenal to convince the five judges. They have invoked the culture of antiquity, previous legal precedents in other countries, the animal kingdom, the fact that homosexuality is innate and not a matter of choice, the relativity of moral values from age to age and ancient Indian temple sculptures.

Participants hold a placard demanding the repeal of Section 377 of the Indian penal code, which bans homosexuality. Photograph: Gurinder Osan/AP

Lawyers argued that for much for its pre-British Raj history, India had been relaxed about depictions of same-sex love; in Hinduism, gods transformed into goddesses and men became pregnant. The famous erotic images on Khajuraho temple in central India included women embracing other women and men displaying their genitals to each other.

It was only when the British settled in India, they argued, that their “rigid Victorian morality” replaced the earlier Indian acceptance of homosexuality.

Other points cited in favour of legalising gay sex were that the Indian Psychiatric Society had called for decriminalisation because homosexuality was not a disorder; that homosexuality was found in many species of animals; and that the 2003 Lawrence v Texas ruling that struck down sodomy laws had provided the basis for providing legal protection to lesbian, gay, bisexual and transgender people in the US.

However, not everybody in largely conservative India wants the law to change. On Tuesday, Bharatiya Janata party MP Subramanian Swamy told reporters: “It is not a normal thing. We cannot celebrate it. We should invest in medical research to see if it can be cured.”

On the question of gay marriage, the additional solicitor general urged the judges to restrict themselves to legalising gay sex and not venture into topics such as gay marriage, adoption or inheritance rights.

But Mehra said he couldn’t believe the positive atmosphere in court. “The whole court room radiated positivity,” he said. “I had to pinch myself and ask: ‘Am I in the same country?’ The judges had to understand that this was about human beings, about real lives – and we did that.”

The hearing continues.