Spain has offered to take in a ship stranded in the Mediterranean with 629 migrants aboard after Italy and Malta refused to let the vessel dock, as an NGO raised fears for their safety due to deteriorating weather conditions.
Aid workers warned that fresh food and drink supplied by the Maltese navy to the Aquarius on Monday would only last until Tuesday.
The migrants, including pregnant women and scores of children, were saved by French charity SOS Mediterranee on Saturday.
"This mobilization is a very positive signal although reaching Spain would require several days of sailing. With so many people on board under deteriorating weather conditions could become critical," the NGO said on Twitter late Monday.
"Safety of all rescued people should remain the priority before all."
Malta and the new populist government in Italy both refused to take the migrants in, accusing each other of failing to meet their obligations.
The refusal to accept the Aquarius in Italy was the first major anti-migrant move since far-right Interior Minister Matteo Salvini took office this month.
Salvini tweeted "VICTORY" after two days of confrontation with Malta over the migrants ended with Spain's offer of help.
The new Spanish administration headed by Socialist Prime Minister Pedro Sanchez agreed to allow the Aquarius to dock at its eastern port of Valencia, insisting that it was an "obligation" to do so.
But Spain's new foreign minister, Josep Borrell, said the gesture was also intended to underline the need for solidarity from the entire bloc.
"Italy has received an enormous influx of migrants and so far other European countries haven't shown much solidarity," Borrell told a news briefing in Madrid.
There was, he said, a "need for Europeans... to face up, in a united and coordinated manner, to a problem that is a problem for all, and not just for Greece one year and for Italy the next".
- Fresh supplies -
SOS Mediterranee director general Sophie Beau earlier warned that the ship would have to travel some 1,300 kilometres (800 miles) to reach the Spanish coast -- which AFP estimates could take at least four days -- and that by Tuesday "there will be no more food (on board) apart from energy biscuits".
"The Aquarius has just received a resupply of 950 bottles of water, 800 packs of noodles and snacks from a vessel of the Maltese navy," the SOS Mediterranee tweeted Monday, adding that this would only allow for one more meal on Tuesday.
Malta and Italy thanked Spain for stepping up, but maintained their dispute over who was responsible.
Malta's Prime Minister Joseph Muscat tweeted his thanks to Sanchez "for agreeing to accept the Aquarius after Italy violated international law and caused an impasse".
He added: "It will be necessary to sit down and discuss how to prevent this kind of thing from happening in the future. This is a European issue."
Italy's Prime Minister Giuseppe Conte said his country had "asked for a gesture of solidarity from Europe and this gesture has been made".
Conte is set to head to Paris for talks with French President Emmanuel Macron on Friday ahead of the European summit on June 28-29, with a particular focus on migration, Macron's office said Monday.
But Beau said that under maritime law the ship should be allowed to dock in one of the nearest countries, Italy or Malta.
- 'Close the doors' -
The UN had called on Malta and Italy to immediately allow the boat to dock, describing the situation as "an urgent humanitarian imperative".
The EU and its biggest member state Germany made similar pleas.
"The priority of both the Italian and Maltese authorities should be ensuring these people receive the care they need," European Commission spokesman Margaritis Schinas told reporters, calling for a "swift resolution".
But Salvini refused to back down.
"Saving lives is a duty, turning Italy into a huge refugee camp is not. Italy is done bending over backwards and obeying, this time THERE IS SOMEONE WHO SAYS NO," he wrote on Twitter followed by the hashtag #closethedoors.
Despite his refusal to accept Aquarius, the Italian Coast Guard ship Diciotto, carrying 937 migrants, was expected to dock in Sicily Tuesday or Wednesday.
- 'Vulnerable patients at risk' -
MSF Sea (Doctors Without Borders) said the medical situation of those on the Aquarius was "stable for now but unnecessary delay to disembarkation in safe port puts vulnerable patients at risk."
"Particularly seven pregnant woman, 15 with serious chemical burns and several critical drowning hypothermia patients," MSF Sea added.
Conte said Sunday that Rome had sent two patrol ships with doctors on board "ready to intervene and ensure the health of anyone on board the Aquarius who might have the need".
The migrants were rescued in six separate night-time operations in the central Mediterranean on Saturday.
- 'Land of refuge' -
Under EU rules, migrants must apply for asylum in the European country where they first arrive.
That has put pressure on Italy and Greece, the entry points for hundreds of thousands of people fleeing war and poverty in the Middle East, Africa and Asia since 2015.
EU leaders in December had set an end-of-June deadline for an overhaul of rules to create a permanent mechanism to deal with migrants in the event of a new emergency.