LONDON — Two gay failed asylum seekers in Britain who said they faced persecution over their sexuality if they were sent home won their Supreme Court appeals against their deportation on Wednesday.

The men, identified only as "J" from Iran and "T" from Cameroon, had been refused asylum on the grounds that they could avoid ill-treatment by behaving discreetly or keeping their sexuality secret in their native countries.

The Supreme Court said that ruling went against the Convention on the Status of Refugees and sent their cases back to the lower Court of Appeal to be reassessed in the light of their verdict.

Home Secretary Theresa May welcomed Wednesday's ruling.

"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," the interior minister said.

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

Cameroonian "T" said he was attacked by a mob after being seen kissing a male partner.

"J", from Iran, was told in the original ruling that he could be expected to tolerate conditions arising from his relationship and should behave discreetly to avoid reprisals.

Punishment for homosexual acts ranges from public flogging to execution in Iran, and in Cameroon jail sentences for homosexuality range from six months to five years.

The Convention on the Status of Refugees provides that people are entitled to asylum if they can establish that they would face a well-founded fear of persecution if they returned home.