The 356 migrants stranded on board the Ocean Viking charity rescue ship will be taken to Malta and then all relocated to other European countries, the Maltese government has announced.
Ocean Viking, operated by the SOS Mediterranee and Doctors Without Borders (MSF) charities, is the latest vessel on the Mediterranean to have been refused port entry, and left stranded for days at sea with rescued migrants on board.
"Malta has agreed to be part of the solution in the Ocean Viking stalemate," a Maltese government statement said.
The migrants will be transferred onto Maltese navy units, taken to Malta and later flown to six other EU member states: France, Germany, Ireland, Luxembourg, Portugal and Romania.
"None [of the migrants] will remain in Malta," Maltese Prime Minister Joseph Muscat tweeted.
The deal was struck "following discussions with the European Commission and a number of member states, namely France and Germany," the government said.
EU Migration Commissioner Dimitris Avramopoulos commended Malta and the EU states that offered to take in the migrants. "These commitments must now be honoured swiftly," he tweeted.
French Interior Minister Christophe Castaner wrote on Twitter that his country would welcome 150 of the 356 rescuees "over the coming days".
The Ocean Viking rescued the migrants, including 103 minors, during August 9-12, meaning that some of them have spent up to 14 days at sea.
In the last few days, the ship was positioned between Malta and Italy's Lampedusa island.
"We are relieved this long ordeal for the 356 people we have on board is finally over. Was it necessary to impose two weeks of excruciating wait for rescued people to be disembarked," Jay Berger, an MSF official aboard the vessel, said in a statement.
"These are people who have fled from desperate circumstances in their home countries and suffered horrific abuses in Libya," he added.
Malta's announcement came a day after MSF warned that the Ocean Viking had only five days of standard food supplies left.
"Our #medical team is increasingly concerned about a rapid deterioration in the state of people's mental health," the charity said.
Italy's outgoing far-right Interior Minister Matteo Salvini, a migration hardliner, had been instrumental in refusing Italian port entry to the Ocean Viking.
"Like we promised, we gave no permission to disembark in Italy for the 356 immigrants on the Ocean Viking. The safety of Italians comes first," Salvini tweeted.
Italy is in the middle of a government crisis that may lead to snap elections in late 2019 which Salvini's League party would be favourite to win.
Australian Associated Press