Luxembourg (AFP) – EU countries cannot imprison illegal migrants just for crossing borders inside the passport-free Schengen area, the bloc’s top court ruled Tuesday, in a new blow to efforts to crack down on the migration crisis.

The European Court of Justice (ECJ) in Luxembourg said that European Union rules prevent the jailing of non-EU migrants who have illegally crossed a frontier if they have not already been subject to deportation procedures.

The ruling came in the case of a Ghanaian woman, Selina Affum, who was caught by French police at the Channel Tunnel while on a bus from Belgium to Britain using someone else’s passport.

French police placed her in custody for illegal entry to France, and then asked Belgium to readmit her.

The EU court, ruling on Affum’s appeal against her detention, said that it was against the EU’s “return directive” or laws on deporting migrants.

“The return directive prevents a national of a non-EU country who has not yet been subject to the return procedure being imprisoned solely because he or she has entered the territory of a Member State illegally across an internal border of the Schengen area,” it said.

The Schengen passport-free area of 26 European countries has come under severe pressure from the continent’s biggest migration crisis since World War II as people flee war in Syria and elsewhere.

Faced with an an influx of more than one million migrants and refugees in the past year and a half, many Schengen countries have brought back border controls that were dismantled a decade ago.