Spain offered on Monday to take in a rescue ship that is drifting in the Mediterranean sea after Italy and Malta refused to let it dock.
Some 629 migrants are aboard the Aquarius, a vessel operated by the charities Medecins Sans Frontieres and Sos Mediterranee, off the coast of Libya on Saturday.
They included 123 non-accompanied minors, 11 children and seven pregnant women.
Spanish Prime Minister Pedro Sanchez, who took over a week ago, gave orders for the boat to be admitted in the port of Valencia, his office said in a statement.
"It is our duty to help avoid a humanitarian catastrophe and offer a safe port to these people, to comply with our human rights obligations," said the Prime Minister's office.
Italy and Malta are in a tense stand-off over which country should now accept the NGO rescue boat.
The boat first headed towards Italy but the country's new far-right Interior Minister blocked it from docking and said it should go to Malta.
The island-country refused saying it was Italy's responsibility since the rescue was overseen by the Italian coastguard.
Euronews' Annelise Borges is the only TV reporter onboard the vessel. She witnessed the dramatic rescue and says the team aboard says the migrants can stay on the vessel, although food and water resources are running low.