Italy migrants: Who is responsible for helping out at sea?
Italy's decision in June not to accept the rescue vessel Aquarius with more than 600 migrants on board attracted widespread criticism on humanitarian grounds.
Malta's Prime Minister Joseph Muscat said Italy had broken international rules, and the plight of the Aquarius led to a diplomatic row between Italy and France.
Italy's right-wing Interior Minister Matteo Salvini said that although rescuing lives is a duty, "transforming Italy into a vast refugee camp is not".
The ship was eventually diverted to Spain.
So who has the legal responsibility for vessels at sea carrying migrants?
European solution lacking
Arguments between European states over how to manage the flow of migrants have continued for several years, largely as a result of rules which said that refugees should apply for asylum in the first country of entry to the EU.
This, Italy and Greece argued, meant they had to shoulder the overwhelming burden of those arriving by sea.
A spokeswoman for the EU Border and Coastguard Agency, Frontex, told the BBC that its main purpose is border surveillance and security.
However, she said that if a Frontex-operated vessel was in the vicinity of an incident, it would take those rescued to the nearest EU port.
She pointed out that the migrants on the Aquarius were rescued outside of Frontex's normal operational area.
- Spain to accept disputed migrant ship Aquarius
- EU's Mediterranean migrant crisis: Just a mess or cynical politics?
- Macron scolds Italy over Aquarius ship
When the BBC asked the EU Commission for details of the legal responsibilities member states have towards vessels carrying migrants, it referred us to the existing international maritime conventions and laws.
These include the 1974 Convention for the Safety of Life at Sea. This dictates that any ship learning of persons in distress "should proceed with all speed to their assistance".
In addition, the 1982 UN Convention on the Law of the Sea says that every state that has a ship flying its flag should require that ship to rescue those "in distress" at sea.
There is also the 1979 International Convention on Maritime Search and Rescue, which establishes a legal framework for signatories to co-ordinate rescue efforts.
According to the International Maritime Organization, which helped put together some of the principles behind rescue at sea, its member states also have an obligation "to co-ordinate so that persons rescued at sea are disembarked in a place of safety as soon as possible".
A question of definitions
However, there are a number of issues.
One problem is over defining distress, according to Yves Pascouau, editor of the European Migration Law website. which offers advice on asylum and immigration law across the EU.
"This is a question of interpretation," he says.
The Aquarius was not in obvious mechanical difficulty as it approached Maltese and Italian waters and he adds: "They (Italy and Malta) did not consider the definition of distress had been met."
In addition, the Maltese authorities had provided some food and water to those on board.
However, the ship was reported to be carrying more than 120 unaccompanied minors and seven pregnant women.
A journalist on board said many people were sleeping outside and exposed to the elements.
The NGOs operating the vessel argued that not allowing it to dock in Italy and making those on board spend more days at sea in order to reach Spain would expose them to further hardship.
There are also issues over what constitutes a place of safety, and whether that means disembarking those rescued at sea on land.
"There is no obligation on a state responsible for a specific search and rescue area, or responsible for co-ordinating a rescue effort, to receive the survivors on land," says Ainhoa Campas Velasco of the Institute of Maritime Law at University of Southampton.
However, she points out that humanitarian considerations are meant to form part of search and rescue operations.
And she adds that it seems that Italy was co-ordinating rescue work when the Aquarius - operated jointly by Doctors without Borders (MSF) and the Franco-German charity SOS Méditerranée - picked up migrants off Libya.
Italy has made clear that it doesn't want NGO-operated vessels bringing people into the country, although it did allow one of its own coastguard vessels to dock carrying more than 900 migrants it had rescued off the coast of Libya.
It's also worth remembering that under maritime regulations, states have the authority to allow or refuse permission for vessels to enter their territorial waters.