A bitter standoff between Italy and Malta over a boat carrying hundreds of migrants that neither country would allow to dock was resolved on Monday after Spain agreed to take in the vessel.
The Aquarius, manned by the charity SOS Mediterraneé, had picked up the 629 migrants from inflatable boats that had been struggling to stay afloat off the coast of Libya at the weekend.
Among those saved were 123 minors and seven pregnant women, the charity said.
The Spanish authorities said the Aquarius could dock at the eastern city of Valencia. The boat was still several hundred nautical kilometres away from the Spanish coast on Monday night.
After picking up the migrants, the Aquarius had initially approached Italy, but the country's interior minister, Matteo Silvini, said he would not let it dock. "Saving lives is a duty, turning Italy into a huge refugee camp is not," said Mr Silvini, who is leader of the far-right League party, which recently took power in a populist coalition.
“Italy is done bending over backwards and obeying – this time THERE IS SOMEONE WHO SAYS NO,” he wrote on Twitter.
SOS Méditerranée reported that the Italian sea rescue authorities had told the Aquarius to remain in its position on Sunday, virtually equidistant between Italy and Malta, despite the willingness of cities such as Naples and Palermo to let its passengers disembark.
The Maltese prime minister, Joseph Muscat, said his country would not take in the boat either. Mr Muscat accused Italy of violating international rules and "creating a dangerous situation for all those involved".
On Monday the boat's predicament threatened to become a full-blown crisis for the European Union, as well as a humanitarian emergency. Both the EU and the UN's refugee agency, the UNHCR, appealed for Italy and Malta to end the impasse.
"Broader issues such as who has responsibility and how these responsibilities can best be shared between states should be looked at later," Vincent Cochetel, the UNHCR's special envoy for the Mediterranean, said in a statement.
The agency warned that the migrants on board were becoming increasingly distressed and that the overcrowded boat was running out of provisions.
Monday afternoon’s surprise announcement by Spain’s Socialist prime minister, Pedro Sánchez, that his country would take in the vessel, finally defused the confrontation.
“It’s our obligation to help avoid a humanitarian disaster and to offer a safe harbour to these people,” Mr Sánchez said, adding that doing so meant “fulfilling international law”.
The gesture had the support of the president of the Valencia region, Ximo Puig, and the mayor of Valencia, Joan Ribó. The mayor of Barcelona, Ada Colau, also offered to take in migrants from the boat, as did the president of the Basque region, Íñigo Urkullu.
While the Maltese government and European Commission thanked Spain for its gesture, Mr Salvini, who ran on an anti-immigration platform in Italy's recent election, celebrated. "Victory," he wrote on Twitter. "629 migrants on board the boat 'Aquarius' on their way to Spain. First goal achieved."
Spain's foreign minister, Josep Borrell, responded by saying that "without a doubt it is a victory for the people on the boat".
Last year, an estimated 171,000 migrants reached Europe by sea, according to the International Organisation for Migration (IOM), more than 3,000 of whom died on the way. The majority of those who reached Europe arrived via Italy, and most of the rest via Greece, Cyprus and Spain.
Although Spain’s intervention broke the political deadlock on this occasion, the question remains as to how the EU and its member states will handle the next crisis of this kind.