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.
France, Germany, Ireland, Luxembourg, Portugal, and Romania will host them, the EU's migration commissioner Dimitris Avramopoulos said.
France has agreed to accept 150 of the migrants and Portugal up to 35. The other allocations are not yet clear.
EU Migration Commissioner Dimitris Avramopoulos negotiated the deal with Malta and the other six EU countries.
On Tuesday, about 100 migrants stranded aboard another rescue ship, the Open Arms, disembarked on the Italian island of Lampedusa after 19 days at sea. They were only allowed ashore once five other EU countries had similarly agreed to host them.
Italy's Interior Minister Matteo Salvini calls the rescue ships taxis for people-smugglers and refuses to let them dock in Italy. His tough stance has contributed to the current turmoil in Italian politics, with the collapse of his coalition deal with populist Five Star.