Portugal has offered to take in 10 migrants from the Aquarius rescue ship as Europe once again finds itself divided over what to do with the large number of people crossing the Mediterranean and arriving on its shores.

Lisbon said it had agreed to the 10 people as a “response of solidarity to the flow of migrants seeking to reach Europe across the Mediterranean”. As part of the deal, France will take 18 migrants and Spain and Germany 15 each.

SOS Méditerranée, the NGO that operates the ship, said on Monday it was making for the French port of Marseille carrying 58 people who had been rescued off the coast of Libya but the French government had signalled it was reluctant to welcome the boat, saying it should dock at the nearest safe port to its location near conflict-torn Libya.

Malta, the EU country closest to the ship, on Tuesday said migrants would be transferred to a patrol boat in international waters and taken to the island, which will then send them to the four other member states.

“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.

Paris had earlier said it was seeking a “European solution” to share out the migrants, similar to that agreed in August when five different countries took in passengers the Aquarius picked up during the Mediterranean crossing.

The Aquarius became the focus of global attention in June after both Italy and Malta refused to let the vessel dock in their ports to let the 360 migrants and refugees it had rescued disembark.

The passengers – who included at least seven pregnant women, 104 children and teenagers and people suffering from burns caused by fuel – were eventually welcomed into the port of Valencia by the Spanish government.

Italy’s far-right interior minister, Matteo Salvini, has vowed to block the Aquarius permanently from his country’s ports, accusing it of offering a “taxi service” for migrants from Libya to Europe.

His government says Italy has had enough of migrants arriving by boat, with more than 700,000 landing on its shores since 2013.

The numbers have dropped sharply since their peak in 2015, but the UN’s refugee agency, the UNHCR, has warned that the death rate during Mediterranean crossings has soared.

At least 1,730 people have died trying to make the treacherous crossing in flimsy boats this year, according to the International Organisation for Migration.

The Aquarius is the last private rescue ship operating in the area used for crossings from Libya to Europe. Last month, it spent 19 days docked in Marseille after Gibraltar revoked its flag, but set sail again last week after acquiring Panamanian recognition.

On Monday, however, Panamanian authorities revoked the vessel’s registration in a move described by Médecins Sans Frontières and SOS Méditerranée, as “a major blow” to its humanitarian mission.

They claimed that Panama was forced to revoke the registration after coming under pressure from the Italian government. Salvini has denied his government was responsible. Writing on Twitter on Sunday, he claimed he did not know the telephone dialling code for Panama.

Reuters and AFP contributed to this report