Mediterranean Migrants
The EU's top court ruled Thursday that European Union countries can imprison migrants who re-enter their territory after being expelled. Pictured: Syrian refugees arrive on the shores of the Greek island of Lesbos after crossing the Aegean Sea from Turkey on a inflatable dinghy Sept. 11, 2015. Angelos Tzortzinis/AFP/Getty Images

BRUSSELS (Reuters) - European Union countries can imprison migrants who re-enter their territory after being expelled, the EU's top court ruled on Thursday in a judgment likely to be closely watched across the continent as it struggles to cope with a migration crisis.

The European Court of Justice was considering the case of an Albanian national who was deported from Italy in 2012 but returned to the country, in breach of a three-year entry ban.

Judges at the Luxembourg-based court ruled that Italian legislation prescribing a one- to four-year jail term for such an offense was in line with EU law.

More than half a million migrants have entered the European Union this year. Some are eligible to claim asylum, for example those fleeing Syria's civil war. Others, notably from the western Balkans, are generally considered economic migrants who must return home.