The Court of Justice in Luxembourg has ruled in favour of a Nigerian asylum seeker who was forced to prove his homosexuality through a number of tests.

The refugee applied for asylum in the Hungarian city of Szeged back in 2015, saying that he could not return to his home country for fear of his safety as a gay man.

Homosexuality is illegal in Nigeria, with the maximum penalty in the states governed by Shari’a Law death by stoning.

However, immigration officials didn’t believe his plea and forced him to undergo psychological testing to prove his sexuality.

The procedure involved the asylum seeker taking the Rorschach ink-blot test and drawing a picture of a person in the rain.

After the testing, a state-appointed psychologist determined that the refugee wasn’t gay, and his claim was denied.

The European Court of Justice concluded that it is acceptable for immigration authorities to collect expert opinion, but that it shouldn’t form the sole basis of the decision.

via Flickr

Related: Canadian government are giving asylum to gay refugees in Chechnya

They added that an asylum seeker’s civil liberties need to be respected during the process.

“The performance of such a test amounts to a disproportionate interference in the private life of the asylum seeker,” the court stated.

LGBTQ rights activists welcomed the ECJ’s ruling, with Katrin Hugendubel‏, advocacy director for ILGA-Europe, saying that it is “an important step against one of the many problems and humiliations LGBTI refugees still face in many EU member states.”

The refugee’s application will now be reconsidered in light of this decision by the ECJ.

What’s more, the ruling sets a precedent that should be adhered to by all 28 EU member states, including Britain.

Hundreds of gay people for African nations, the Middle East, and more recently Chechnya, have sought asylum in Europe for fear of being killed in their home countries based solely on their sexuality.

In 2017, the Home Office unveiled data that showed that for the past two years more than 66% of asylum seeker applications involved sexuality.

Related: Gay refugee goes on Chechen state television to apologise for being a ‘disgrace’