The row has triggered worldwide concern about the migrants' plight.
Following up on his campaign promises, the new Italian interior minister and deputy Prime Minister Matteo Salvini, leader of the right-wing League party, said the ship would not be allowed to dock in Italy and suggested that as it was closer to Malta, it should dock there.
"If anyone thinks I won't move a muscle while we have another summer of landings, landings and more landings, well that's not what I'm going to do", Salvini told reporters.
In Spain, Mr Sanchez ordered authorities in Valencia to open the port, saying "it's our duty to avoid a humanitarian catastrophe and offer a secure port for these people". Spain's prime minister offered to let it port in Valencia.
Since Italy's navy had coordinated the initial rescue effort, and even transferred some of the migrants its own navy had saved to the rescue ship staffed by volunteer aid workers, it was obliged by global law to ensure their safety. The mayor of Taranto, Rinaldo Melucci said the southern port city was "ready to embrace every life in danger".
The Aquarius ship at sea.
Italy and Malta may be at odds over the fate of a migrant rescue boat, but their governments are pledging to work together to identify those migrants who have died or gone missing over the years in the Mediterranean.
"What does worldwide law say? This is a European issue".
HUNDREDS of migrants marooned at sea for days after Italy and Malta refused them entry were last night heading for Spain where the prime minister offered them safe harbour.
The EU and the bloc's biggest member state Germany made similar pleas.
Salvini refused to back down.
The migrant influx has led to a populist backlash, with Salvini vowing to prevent Italy from becoming the "refugee camp of Europe". "Italy has stopped bowing its head and obeying, this time THERE IS SOMEONE WHO SAYS NO. #chiudiamoiporti (#weareclosingtheports)", Salvini wrote on Twitter, as quoted by the Ansa news agency.
"Denying disembarkation to desperate people rescued at sea can not be considered as a victory: it is the wrong response to the lack of responsibility and burden sharing between member states", said Aloys Vimard, MSF's project coordinator on board Aquarius.
"Particularly seven pregnant woman, 15 with serious chemical burns and several critical drowning hypothermia patients", the NGO said.
Rescuers warned of deteriorating weather conditions facing the 629 people - including pregnant women and scores of children - who have been crammed on the Aquarius vessel since being plucked from the sea off the Libyan coast at the weekend.
Under EU rules migrants must apply for asylum in the European country where they first arrive.
Euronews' Paris correspondent Anelise Borges was on board the Aquarius ship, operated by Doctors without Borders and SOS Mediterranee.
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.
Italy has long protested that sending migrants to the nearest port has distributed Europe's burden unequally, hitting Italy particularly hard.