Almost 360 migrants rescued by the charity-run rescue vessel Ocean Viking reached Malta late on Friday night, as part of an EU-brokered deal that will see them relocated to six different EU countries.
Wearing bright orange lifejackets and crammed aboard an Armed Forces of Malta boat, the 356 men, women and children were brought to Hay Wharf, disembarked and processed.
They will all be relocated to France, Germany, Ireland, Luxembourg, Portugal and Romania as part of a deal negotiated between the European Commission, France and Germany.
The Ocean Viking had spent almost two weeks stuck between Malta and Lampedusa after it was denied entry into the small Italian island, having rescued its passengers in a series of rescue missions.
Prime Minister Joseph Muscat announced on Friday that the stalemate had been broken by saying that Malta would be "part of the solution" in a tweet.
After discussions with France and Germany, Malta "agreed to be part of the solution in the Ocean Viking stalemate, which has 356 persons on board, without prejudice to its legal position," he said.
The deal saw the migrants transferred to an AFM boat and then brought to Malta.
In a statement the government said more people who have arrived in Malta recently will be transferred to other member states as part of the agreement.
The EU Commission thanked Malta for its "cooperation and support". The ship's operators said they were "relieved" a solution had been found after "14 days of unnecessary suffering".
How did we get here?
Dr Muscat's statement ended a stalemate that has lasted almost two weeks. The Ocean Viking, formerly the Aquarius, is operated by SOS Mediterranean and Doctors Without Borders (MSF).
The ship had been patrolling international waters some 50 nautical miles off Libya and most of those on board were picked up in that area.
Malta and Italy previously denied the boat, and a second ship, the Open Arms, entry.
Earlier this week, the standoff with the Open Arms was resolved, leaving the Ocean Viking stranded at sea.
What has the reaction been?
European Commissioner Dimitris Avramopoulos praised Malta for being involved in the breakthrough.
“I would like to in particular commend the cooperation and support of the Maltese authorities who have once again, as they have in so many occasions in the past, shown concrete solidarity by offering the Ocean Viking to disembark in Malta," he said.
"This proves once again the strong commitment of Malta to a European approach on migration in the spirit of solidarity and joint responsibility."
He urged the countries committed to taking in the migrants to honour their promises "swiftly."
The Ocean Viking's operators, said they were "relieved a solution was found" but said those on board had "14 days of unnecessary suffering".
It added: "A European predictable disembarkation system was promised. It needs to happen now."
Where will the migrants go?
After they arrive in Malta, the 356 migrants will be relocated to six EU countries: France, Germany, Ireland, Luxembourg, Portugal and Romania.
However the statement does not say how quickly this process will happen.
Portugal had said on Thursday it will take up to 35 of the 356 migrants who are on board the Ocean Viking," a joint statement from the foreign and interior ministries said.
France also has said it was ready to take in "a large number of migrants" from the Ocean Viking.
What is Italy's role?
Italy's collapsing government has failed to deal with the migrant rescue boats and its anti-immigrant interior minister Matteo Salvini has been accused of leaving migrants to drown in the sea.
Italy is not mentioned in the deal to relocate the 356 migrants on board the Ocean Viking.
Mr Salvini has repeatedly insisted that rescued migrants can only land in Italy if other EU countries take them in.
The mayor of Lampedusa had said on Thursday that the reception centre on the tiny isle was already over capacity and would struggle to house migrants.
What is Malta's position on the migrant crisis?
Unlike Italy, Malta has not issued many public statements on the stalemate around Ocean Viking, and Open Arms, a second migrant ship at the heart of a controversy.
However, in the aftermath of a recent rescue operation, Home Affairs Minister Michael Farrugia emphasised Malta's small size in comparison to other EU countries. He said: 'We cannot do this alone'.
In the statement issued about the stalemate breakthrough, the Maltese government said it was committed to "pragmatic solutions that do not put undue pressure on one single member state".
Privately, it is understood the government is reluctant to help charity ships, as it fears they are encouraging Libya's smuggling gangs.
Correction August 23: Michael Farrugia is Home Affairs Minister.