Six EU countries have agreed to take in 356 African migrants aboard the rescue ship Ocean Viking, which has not been allowed to dock in Italy or Malta.
The migrants, mostly from Sudan, cheered and danced on hearing the news. After talks with the European Commission, Malta agreed its navy would transfer the migrants to the island but not be allowed to stay.
France, Germany, Ireland, Luxembourg, Portugal and Romania will host them.
SOS Méditerranée, one of the French charities involved, had urged a resolution after two weeks at sea. Charities had warned that food supplies on the 69-metre (220-foot) boat were running out and the migrants and staff were jubilant as the deal was announced.
The charity said the Ocean Viking would now change crews, refuel and be resupplied before heading back to Libyan waters.
The boat had been denied entry to dock by both Malta and Italy and is just the latest in a string of migrant ship standoffs.
Italy’s Interior Minister Matteo Salvini calls the rescue ships taxis for people-smugglers and refuses to let them dock in Italy. He accuses EU partners of leaving Italy at risk of becoming “Europe’s refugee camp”.