The Supreme Court allowed appeals today by two gay asylum seekers who faced persecution if returned home.
Both men had been refused asylum in the UK on the grounds that they could avoid ill-treatment by keeping their sexuality secret or behaving discreetly.
The Supreme Court said the test applied by the lower courts should not be used in the future.
The new Government had already promised to review the policy before the Supreme Court ruling.
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."
One of the men involved, known as "T", appealed against a decision that he could return to his native Cameroon, despite the fact that he was attacked by a mob after he was seen kissing a male partner.
The other, known as "J", from Iran, was told he could be expected to tolerate conditions arising from his homosexual relationship in his home country, 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 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.
The Convention on the Status of Refugees provides that members of a particular social group, which can include groups with a common sexual orientation, are entitled to asylum in states that are parties to the Convention if they can establish that they would face a well-founded fear of persecution if returned to their home country.
The Court of Appeal had found that both men could conceal their sexual orientation to avoid the risk of being persecuted and neither had a "well-founded fear of persecution" which entitled them to protection under the Convention.
The Supreme Court justices unanimously found that the test applied by the Court of Appeal was contrary to the Convention and should not be followed in the future.
Both cases will be sent back for reconsideration in light of the guidance provided by the Supreme Court.