Syria refugees journey through Europe
People wrap themselves in blankets to keep warm at a collection point in Morahalom, Hungary - representational image Dan Kitwood/Getty Images

EU countries cannot detain illegal migrants entering the Schengen zone of an EU state, the European Court of Justice in Luxembourg ruled on Tuesday (7 June), stating that rather, migrants be sent back to the country of origin from which they came from, the ruling said.

This applies to all passport-free areas of the Schengen zone, except Denmark, which although a member of the zone can opt out from European Union justice policies.

However, the rule does not apply to the UK and Ireland, as they are not within the Schengen region.

The judgement was prompted by the case of a Ghanaian woman, Selina Affum, who was arrested by the French police for illegally crossing borders and holding fake Belgian travel papers in 2013.

She was later released, as it was against the EU's 'return directive', which "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."

The International Organisation of Migration (IOM) has welcomed the new verdict and said it was "in line with international standards and interpretation on when detention is legitimate — when it is a measure which has a legitimate purpose and is proportionate".

"Most countries do however not use detention as a punitive measure, but detention is too frequently used as an administrative measure. The ruling is important in that it sends a clear signal that the use of detention should be used less and, as stated, as a last resort," Leonard Doyle, spokesman of IOM said, as reported by the BBC.

While the new ruling states that refugees must be given a chance to go home willingly without any force, it also states, "If voluntary departure does not take place, the directive requires the member states to carry out forced removal using the least coercive measures possible. It is only if there is a risk of the removal being compromised that the member state may keep the person concerned in detention, the duration of which may not in any case exceed 18 months."

However, the ruling says that second time offenders - those who had been previously told to leave the zone or are trying to re-enter a country after being deported - can be detained.