By law, it would be hard for Italy to refuse the boat a safe haven, as its own coastguard coordinated the rescues, picking up more than 280 migrants in its own vessels before transferring them to the Aquarius to be taken to safety.
The new Spanish foreign minister said that Spain's decision in accepting the migrant ship is also meant to push European Union leaders to address the bloc's migration policies later this month at an EU summit.
The U.N. refugee agency rejects the argument that boats run by private organizations should stop making such rescues, as they are simply providing an incentive for migrants to make perilous overseas journeys. "Moreover, the weather conditions are adverse".
The 629 rescued migrants on board the ship Aquarius, operated by SOS Mediterranee and Doctors without borders, come from Eritrea, Ghana, Nigeria and Sudan, and include 88 women - seven of which are pregnant - 123 unaccompanied minors and 11 children. The migrants, who were picked up from different boats in Libyan waters, hail from several African countries - including Nigeria, Morocco, Sierra Leone, Algeria and Sudan.
As soon as the decision was made, Italy's Interior Minister, Matteo Salvini of the right-wing, anti-immigration League, sent out a message on Twitter: "VICTORY!"
The Spanish prime minister Pedro Sanchez said he would give the ship "safe harbour" and that he wanted to help avoid a humanitarian emergency.
But Beau said that under maritime law the ship should be allowed to dock in one of the nearest countries, Italy or Malta.
On Friday of last week, it was the first vessel to reach the coast of Libya after a new populist and openly anti-immigrant government had taken office in Italy.
SOS Mediterranee, the charity co-operating the migrant ship, said it was awaiting instructions about where to disembark from Italy's coastguard, which coordinated the sea rescues.
He suggested that Malta should accept the Aquarius, but it refused arguing that it fell under Italy's jurisdiction.
While Spain adopted a diplomatic tone with Italy when it announced it would take the migrants, relations between Rome and Paris have deteriorated in an explosion of accusations and counter-accusations.
"Italy has stopped bowing our heads and obeying", Salvini said in a Facebook post. Another 21 patients suffered severe chemical burns from exposure to sea water mixed with fuel, while others risk pneumonia and yet others need immediate surgery for orthopedic issues.
A US Navy ship rescued 40 migrants off the coast of Libya Tuesday, according to US military officials.
The Italian government, and others like it including Britain's, want hundreds of people to drown to deter others from trying to flee to Europe to escape war, poverty and climate change.