TWO gay men who said they faced persecution in their home countries have the right to asylum in the UK, the Supreme Court has ruled.
The UK court's panel said it had agreed "unanimously" to allow the appeals from the men, from Cameroon and Iran.
They had earlier been refused asylum on the grounds they could hide their sexuality by behaving discreetly.
Home Secretary Theresa May said the judgement vindicated the coalition government's stance.
Under the previous government the Home Office had contested the case, saying it had taken sexuality into account when making its decisions.
The five Supreme Court justices were asked to decide whether a gay applicant could be refused asylum on the grounds that he could avoid ill treatment by concealing his sexuality.
Previous attempts by the men to stay in the UK had been rejected by judges at the Court of Appeal who ruled that if the men could conceal their sexuality, their situation could have been regarded as "reasonably tolerable".
But the applicants said this tolerability test was contrary to the Refugee Convention Act, to which the UK is a party.
The Supreme Court agreed and ruled that the men's cases could be reconsidered.
The applicant from Cameroon, who is only identified as HT, had been told he should relocate elsewhere in his country and be "more discreet" in future.
He had been attacked by an angry mob at home after being seen kissing his partner. He has been fighting removal from the UK for the past four years.
"Some people stopped me and said 'we know you are a gay man'," HT earlier told the BBC.
"I cannot go back and hide who I am or lie about my sexuality."
The other application was from a 31-year-old Iranian gay man, who was attacked and expelled from school when his homosexuality was discovered.
Like HT, he had been told he could be "reasonably expected to tolerate" conditions back home that would require him to be discreet and avoid persecution.
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.