The tension is likely to continue. The increasingly fewer charity groups running rescue missions are vowing to return to maritime routes from Libya. And the European Union is making little progress toward a permanent system to organize sea rescues, especially one that would force all members to comply.
Meanwhile, Italy's hard-line interior minister, Matteo Salvini, blames the charities for aiding human trafficking mafias, part of a tough approach that has pushed up his popularity - and emboldened him to provoke a government crisis that could result in early elections.
The Maltese armed forces were expected to take ashore 356 passengers stuck on the Ocean Viking for the past two weeks, the prime minister of Malta, Joseph Muscat, said. He said all the migrants will be distributed to France, Germany, Ireland, Luxembourg, Portugal and Romania.
Until his announcement, Maltese authorities had denied the ship access and Italy had ignored its requests for docking, in a similar way that at least 19 ships - including fishing vessels, coast guard patrol boats and the EU's own border control fleet - have faced varying degrees of difficulties to disembark over the past year.
On Tuesday, a Sicilian prosecutor ordered the evacuation of 83 rescued aboard the Open Arms, a ship run by a Spanish aid group, after 19 days at sea.
The two charities running the Ocean Viking welcomed Friday's agreement but called for a permanent, sustainable solution for taking in rescued migrants.
"We are relieved that the long ordeal for the 356 people on board with us is finally over, but was it necessary to keep them waiting for two weeks of torment?" said Jay Berger, the on-board operations manager for Doctors Without Borders.
Frédéric Penard, SOS Mediterranee's operations director, said: "We hope that the ad hoc solution implemented today will transform into the predictable and sustainable disembarkation mechanism promised many times by several EU member states."
Italy, notably, but also Malta, Greece and more recently Spain, have felt abandoned by their European neighbors in coping with the arrivals, despite the influx plummeting to a fraction of the levels seen in 2015 and 2016.
France and Germany have since June led an informal group of eight countries trying to help shoulder the burden, although the specific shares of people that each country takes are decided boat by boat, relying largely on goodwill.
The charities say the current ad-hoc approach is impeding more rescues and adding to the suffering of migrants, many of whom have been exposed to war, sexual abuse and torture.
Doctors Without Borders' Sam Turner said that at least 75 of the 356 on the Ocean Viking had been treated for such injuries.
"They experienced horrors during their time in Libya at the hands of traffickers and criminals ... that I can only describe as torture," he said. "Beatings, sexual violence, and all sorts of horrific things that are really unimaginable."
NGOs blame populist and far-right politicians hungry for votes for a crackdown on their operations that has included the prosecution of activists. Aid groups say they are being demonized for filling a vacuum created by the EU's lack of action.
But other governments have more recently joined Rome in imposing administrative obstacles to their ships. Even Spain's Socialist government has threatened hefty fines if Open Arms resumes search and rescue missions without being asked to.
The difficulties have halved the number of aid groups regularly charting ships from a dozen four years ago.
Some 580 people are believed to have died this year in waters between Italy, Malta and Libya, according to the U.N.'s International Organization for Migration. While that number is lower than last year's death toll of 1,130 from January through August, the rate of deaths per estimated crossing is higher.
The constant improvisation is also resulting in ships crammed with migrants and long waits at sea. The Ocean Viking remained out of sight of land since Aug. 9th to avoid agitating passengers eager to reach safety.
Earlier this summer, a German ship operated by Sea-Watch, another aid organization, declared an emergency situation on board and forced its way onto Lampedusa after 17 days at sea.
And in March, migrants hijacked a merchant vessel that had rescued them after being told they were being taken back to Libya.
Only this week, conditions aboard the Open Arms were described as "lousy" in the report by a prosecutor in Sicily that eventually ordered the ship's evacuation and that The Associated Press has seen.
The migrants, the report said, were "caught between the perception of 'death' for fear of being deported and the hope of 'life' in Europe."
The Open Arms remains in a Sicilian port as investigators probe whether politicians committed possible crimes for delaying the arrival of the rescued.
That development, together with a series of recent favorable rulings in Italy, is fueling hope among some activists that their future missions will be easier. But they decry that no country has taken the Italian government to the International Tribunal for the Law of the Sea, in Hamburg, for closing its ports.
"There is a clear and stated contempt for the respect of human lives, but the impunity that we have seen until today might not be there tomorrow," said the Open Arms' mission chief, Riccardo Gati, speaking via phone from Lampedusa.
Gati vowed to return to the central Mediterranean to "save lives" as soon as the boat is released.
The Ocean Viking activists also vowed to restock supplies, refuel and then continue their mission.
AP reporters David Rising in Berlin and Giada Zampano in Rome contributed to this report.
Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.