Spain on Sunday offered Algeciras as a port to disembark more than a hundred migrants on a charity rescue ship stranded off the coast of Italy after the vessel had spent more than two weeks waiting for a safe port to be made available.
The migrants, most of whom are African, were picked up by the Open Arms boat off the coast of Libya and have been waiting to disembark on the southern Italian island of Lampedusa.
Italy's far-right Interior Minister Matteo Salvini has ordered his officials not to let them land, though he made a partial concession on Saturday by allowing 27 minors to leave the boat.
He added that he had only agreed to this at the insistence of Prime Minister Giuseppe Conte.
"Spain always acts on humanitarian emergencies. It is necessary to establish an orderly and supportive European solution, leading the migration challenge with the EU's values of progress and humanism," Spanish acting prime minister Pedro Sanchez said on Twitter.
France, Germany, Romania, Portugal, Spain, and Luxembourg said earlier this week they would help relocate the migrants. Once the boat disembarks in Algeciras, the agreed distribution will take place, the Spanish government said in a statement on Sunday.
Sanchez took the decision to offer Algeciras as a port to dock the Open Arms because of the "emergency situation" onboard, the statement added. It also criticized the "inconceivable response of Italian authorities", especially Salvini's.
Salvini said triumphantly on Facebook that Spain's decision vindicated his hard-line stance.
"Those who stick it out are the ones who win," he said, adding that "probably any other minister would have given in."
He renewed his constant attacks of recent days on Open Arms, accusing it of lying about the condition of the migrants.
He said a medical inspection on the boat by Italian authorities on Saturday had shown there was no sanitary emergency on board as the charity had claimed.
"They tell us to let the sick off the boat and they turn out not to be sick, they say let the minors off and a lot of them turn out not to be minors, we check the medical emergency and there is no emergency," he said.
"There are presumed minors and presumed refugees fleeing from presumed wars."
Open Arms said a few migrants had jumped off the boat and tweeted a video of them trying to swim to shore before being caught up by faster-swimming rescuers who jumped in after them.
"We have been warning for days, there is a limit to people's desperation," tweeted Oscar Camps, the charity's director and founder. "What more does Matteo Salvini need for his political campaign - deaths?"
Salvini, leader of the ruling League party, has built his popularity on a vigorous campaign against illegal immigration.
He issued a statement on Saturday reiterating that Open Arms could have taken the migrants to Spain and that the non-governmental organization was to blame for their plight.
Open Arms said on Saturday it could not guarantee the security of the migrants and Camps said there were constant fights on board and the tension was unsustainable.