Tony Blair’s former attorney general, Lord Goldsmith, is to challenge the government of Singapore over its laws banning sex between men.

Section 377A of the Singapore penal code makes sex between two men punishable by up to two years, although it is rarely enforced.

Oral and anal sex between consenting heterosexual women and lesbians were sanctioned after the penal code was reviewed in 2007 – although the ban remains in place for men who have sex with men.

Lord Goldsmith, of the international legal firm Debevoise & Plimpton, is now helping Gary Lim and Kenneth Chee on a pro-bono basis in their campaign to overturn Section 377A.

Singapore’s High Court rejected their case in April and insisted it was a matter for Parliament.

It was also rejected by the Court of Appeal.

Lord Goldsmith said: “This is not about an English QC going to Singapore to make money. We want to take on the case because we believe this is an important issue.”

He added: “There are still over 70 countries where homosexuality is illegal. Gay men and women are still living in fear of being imprisoned. I am hoping that I will be admitted to act on the case together with the Singaporean counsel, bringing my experience in this area and the international comparison of law.”

Lord Goldsmith will learn in August if the High Court in Singapore will allow him permission to enter the country in order to represent Mr Lim and Mr Chee.

The couple argue Section 377A violates Singapore’s Constitution.

Singapore’s first openly gay politician, Vincent Wijeysingha, recently urged lawmakers to abolish the country’s homophobic legislation.

“I am entirely convinced the law will eventually be repealed,” Mr Wijeysingha said ahead of the Pink Dot event, a major LGBT festival held last month. 

Last month, Lord Goldsmith took part in a similar legal challenge in Belize.

Lord Goldsmith is a supporter of the Human Dignity Trust, a foundation that uses the law to fight homophobia overseas.