The EU's top court said on Monday that officials can detain migrant rescue ships, but only if they can prove there is a real risk to health, safety or the environment, in mixed guidance on a case testing Europe's response to refugees.
German campaign group Sea Watch launched a legal challenge after Sicilian port authorities detained two of its vessels that had rescued migrants in the Mediterranean and taken them to Sicily in 2020.
Italian judges hearing the complaint asked the European Court of Justice (ECJ) for guidance on the case that goes to the heart of disputes over how to respond to the tens of thousands of people risking the crossing from Africa every year.
Sea Watch, which patrols the Mediterranean to pick up migrants in distress - a practice which some European states say encourages migration - is arguing that the port authorities exceeded their authority by detaining the vessels.
The Sicilian ports of Palermo and Empedocle argued at the time that they had searched and detained the vessels on the grounds that they were overcrowded and not registered for search and rescue operations, according to the ECJ.
The Luxembourg-based EU court delivered a mixed ruling which could support arguments on both sides of the case.
It said port authorities have the right to check and detain ships under certain circumstances, though the mere fact that a vessel is carrying people rescued at the sea does not offer sufficient grounds for that.