The Supreme Court has ruled that two gay men from Iran and Cameroon have the right to asylum in the UK.

The pair took their cases to the court after being told by the Home Office they could safely return home if they were “discreet” about their sexual orientation.

The Cameroonian man, HT, argued he was told he could be sent home despite being attacked after he was seen kissing his partner.

The Iranian man, HJ, was told by a tribunal that he must expect persecution for his homosexuality and could avoid it by being discreet.

Lord Hope, who read out the judgment, said: “To compel a homosexual person to pretend that his sexuality does not exist or suppress the behaviour by which to manifest itself is to deny him the fundamental right to be who he is.”

An earlier Court of Appeal decision said the government could return the pair to their home countries on the basis that they could be discreet, despite homosexuality being illegal in both countries and HT suffering violence from his neighbours.

The case was brought on behalf of the men by the London office of the United Nations High Commissioner for Refugees.

The men’s lawyer, Iona Harding, of Baker & McKenzie, said: “This is an excellent result which will ensure that lesbian, gay and bisexual people receive the protection they are entitled to as refugees in the UK and are not expected to hide their identity in order to escape execution, long prison sentences or other forms of persecution.”

Gay asylum campaigner Paul Canning told PinkNews.co.uk that the decision had “extremely broad implications” for gay asylum seekers in other countries due to the EU trying to bring standardise asylum policy.

He added: “This is a clear victory. It is one in the eye for the last government.”

The court’s judgment said that the term “concealment” was preferred to discretion, as this recognises that gay people in homophobic countries may need to be dishonest about their sexuality and that the average person would find it intolerable to have to conceal their sexuality for fear of persecution.

It added that UK authorities must consider whether asylum applicants have to conceal their sexuality at home for fear of persecution and if so, they should be given refugee status regardless of whether they can successfully keep their sexuality secret.

The coalition government has said it will introduce new rules to prevent the deportation of any gay asylum seeker who faces “imprisonment, torture or execution” if sent home.

Neither HT or HJ were at risk of torture or execution and neither said they had been imprisoned.

Home secretary Theresa May said: “I welcome the ruling of the Supreme Court, which vindicates the position of the coalition government.

“We have already promised to stop the removal of asylum seekers who have had to leave particular countries because their sexual orientation or gender identification puts them at proven risk of imprisonment, torture or execution.

“I do not believe it is acceptable to send people home and expect them to hide their sexuality to avoid persecution.

“From today, asylum decisions will be considered under the new rules and the judgment gives an immediate legal basis for us to reframe our guidance for assessing claims based on sexuality, taking into account relevant country guidance and the merits of each individual case.

“We will, of course, take any decisions on a case-by-case basis looking at the situation in the country of origin and the merits of individual cases in line with our commitment.”