Gay people can seek asylum in the EU if they risk being jailed in their home countries, the EU's top court ruled on Thursday (7 November).

The Court of Justice (ECJ) in Luxembourg said the existence of criminal laws specifically targeting homosexuals means that they could be classified as a "particular social group" which is perceived by surrounding society as different.

Student or retired? Then this plan is for you.

The ruling came after the Netherlands queried whether homosexuals could be considered a "particular social group" and whether the threat of incarceration amounts to persecution.

The ECJ noted that laws banning homosexuality are not enough to justify refugee status.

But it added that EU national governments must decide whether the threat of jail might actually be carried out, noting that "a term of imprisonment which accompanies a legislative provision which punishes homosexual acts may constitute an act of persecution per se, provided that it is actually applied."

The case was brought by three gay men from Senegal, Sierra Leone and Uganda.

They sought refugee status in the Netherlands fearing that they would be persecuted in their home countries because of their sexuality.

Homosexuality is illegal in more than 30 African countries, with punishments ranging from death to severe or lighter jail sentences.

Three countries - Nigeria, Mauritania and Sudan - retain the death penalty. Being caught committing homosexual acts in Sierra Leone, Tanzania or Uganda, puts you at risk of lifetime in jail.

For his part, British centre-left MEP Michael Cashman, who chairs a European Parliament group on lesbian, gay, bisexual and transgender rights, described Thursday's verdict as a "landmark decision, and the right one."

He called on governments to make sure that "our asylum procedures become more accommodating of the terrible realities [which] people flee."

Human rights campaign group Amnesty International complained the ruling does not go far enough, however.

"The court should have found that these laws, even when they have not recently been applied in practice, are capable of giving rise to a well-founded fear of persecution," said Amnesty's Livio Zilli in a statement.

The ruling comes after EU foreign ministers in summer endorsed a 20-page paper committing them to "actively promote and protect" the rights of sexual minorities outside Europe.