SINGAPORE (Reuters) - A veteran Singapore diplomat has called on the gay community to challenge a law that bans gay sex in the conservative city-state, following India’s scrapping of similar British colonial-era legislation.

FILE PHOTO: A woman holds a rainbow flag at the Pink Dot rally, Singapore's annual gay pride rally, at a park in Singapore July 1, 2017. REUTERS/Darren Whiteside

Tommy Koh, a diplomat and lawyer, made the comments on Facebook on Thursday in response to a post by a senior Singapore-based academic on India’s landmark ruling.

“I would encourage our gay community to bring a class action to challenge the constitutionality of Section 377A,” Koh wrote.

Under 377A, a man found to have committed an act of “gross indecency” with another man could be jailed for up to two years, although prosecutions are rare. The law does not apply to homosexual acts between women.

Previous legal challenges in 2014 failed. Reminded of this by another Facebook user, Koh wrote: “Try again.”

Home Affairs and Law Minister K. Shanmugam told reporters on Friday that the majority of Singaporeans were opposed to any change to the law but that “a growing minority, want it (377A) to be repealed”.

He added that, in his personal view, care must be taken over criminalizing sexual attitudes.

Prime Minister Lee Hsien Loong has previously said that Singapore society “is not that liberal on these matters”. The prime minister’s office did not have further comment on Friday.

Koh did not immediately respond to a request for comment.

A spokesman for LGBT rights group PinkDot said that it had been told in its last constitutional challenge that it was up to parliament, not the courts, to change the law.

“We hope that parliament will consider the decriminalization of S377A...We are ready to keep up with India.”