France, Portugal and Spain struck a deal on Tuesday to take in migrants from the Mediterranean rescue ship Aquarius sailing off the coast of Malta, the Portuguese Interior Ministry said, after the Italian government refused to let the vessel dock.
Portugal said it had agreed to take 10 of the 58 migrants on board as part of a "response of solidarity to the flow of migrants seeking to reach Europe across the Mediterranean".
Malta said migrants would be transferred to a patrol boat in international waters and taken to the island, which will then send them to four other European Union states.
It was not immediately clear how many migrants France and Spain had agreed to take in and who the fourth EU country was.
"Malta and France again step up to solve (the) migrant impasse," Maltese Prime Minister Joseph Muscat said on Twitter, adding that he, French President Emmanuel Macron and other leaders wanted to show a multilateral approach was possible.
On Sunday, Italian Interior Minister Matteo Salvini of the far-right League Party said the Aquarius had hindered the work of the Libyan coast guard and Italy's ports would remain shut.
A public backlash over the arrival of hundreds of thousands of migrants in the past five years has fuelled a swing towards far-right parties in many countries in Europe and helped bring Italy's anti-establishment ruling coalition to power this year.
Earlier on Tuesday, France said it was not ready to let the Aquarius dock in Marseille, as requested by the charities operating the ship, adding that a European solution involving the nearest port, Malta, was in the works.
"For the moment it's 'no'," Finance Minister Bruno Le Maire said when asked on BFM TV if Paris was ready to respond positively to a request from the charities for permission to dock in France's southern French port.
Le Maire said ships were supposed to dock at the nearest port under European rules and Marseille was not the nearest.
A source in the French president's office said: "We're working on a European solution, as we've done before."
In August, France and Malta struck a deal to let the Aquarius dock in Valletta harbour after France, Germany, Luxembourg, Portugal and Spain agreed to take in the migrants, ending a five-day tug-of-war among EU countries.
Aquarius 2 is the one remaining charity rescue vessel still operating in the central Mediterranean, picking up migrants who are in most cases trying to get to Europe from Libya, often in overcrowded, unseaworthy boats.
On Monday, Panama authorities revoked the Aquarius's registration, meaning that once it docks it will be 'de-flagged' and will not have the right to sail unless a new registration is found.