Spain offered Monday to take in a rescue ship that is drifting in the Mediterranean sea with 629 migrants on board after Italy and Malta refused to let it dock.
The Aquarius ship picked up the migrants, including 123 unaccompanied minors, 11 other children and seven pregnant women, from inflatable boats off the coast of Libya during the weekend.
Spanish Prime Minister Pedro Sanchez, who took office just over a week ago, has given instructions for the boat to be admitted to the eastern port of Valencia, his office said in a statement.
The Spanish decision came just hours after the European Union and the United Nations refugee agency had called on Italy and Malta to let the rescue ship in and end the standoff after the two governments traded accusations of not doing enough amid the migrant crisis.
"People are in distress, are running out of provisions and need help quickly," the U.N. refugee agency said, urging governments to set aside political considerations.
"Broader issues such as who has responsibility and how these responsibilities can best be shared between states should be looked at later," UNHCR special envoy Vincent Cochetel said.
SOS Mediterranee said the Gibraltar-registered ship had enough supplies to feed the migrants, at least for another day.
It sailed north toward Italy, but Matteo Salvini, the head of the far-right League party who became interior minister this month vowing to crack down on the influx of migrants from Africa, blocked the ship and said it should go to Malta instead.
Malta refused, saying it had nothing to do with the rescue mission, which was overseen by Italian coastguard. The island nation with fewer than half a million inhabitants says it already accepts more refugees per capita than Italy, which has taken in more than 600,000 boat migrants since 2014.
Pictures from aboard the Aquarius, which is operated by SOS Mediterranee and Doctors without Borders, showed hundreds of Africans huddled aboard, including a young girl wrapped in a blanket in the arms of a rescue worker.
Not everyone in Italy agreed with the government action, and the mayors of a number of southern cities, including Naples, Palermo and Messina, said they would welcome the migrants.
Palermo Mayor Leoluca Orlando said Salvini was "violating international law which makes saving lives a priority".
The European Commission also stepped in and urged an end to the standoff in favor of ending the suffering of the stranded human beings.
"We are talking about people ... The priority of both the Italian and Maltese authorities should be ensuring these people receive the care they need," Commission spokesman Margaritis Schinas told a news conference.
"We call on all involved to contribute to a swift resolution so that the people on board the Aquarius vessel may be safely disembarked as soon as possible."