Updated at 6pm with UNHCR statement

Tired and weary but ecstatic, 49 men, women and children walked on land on Wednesday afternoon after a long journey at sea which saw them finally reaching Malta.

The migrants, who will be shared with Germany, France, Portugal, Ireland, Romania, Luxembourg, the Netherlands and Italy, spent 19 days aboard two NGO rescue ships.

They were refused entry first by Italy - which was legally bound to allow them in - and then by Malta until Wednesday, when an agreement was finally reached on the distribution deal.

As part of the relocation deal, a majority of a separate group of 249 migrants brought to Malta by AFM patrol boats in December will also be taken to other EU countries. 

The agreement was announced by Prime Minister Joseph Muscat and welcomed by opposing politicians, NGOs, Bishops, the UNHCR and Council of Europe, among others.  

"220 persons will be relocated to other member states or be returned to their county of origin," Dr Muscat said.

Christmas rescues

Most of the group of 49 migrants, including women and young children, were rescued by the MV Sea-Watch 3 three days before Christmas.

Others were picked up by the MV Sea Eye. The rescues were made between Libya and the Italian island of Lampedusa, but Italy refused to open its harbours for the ships.

Malta did likewise, though last week it allowed the vessels to enter its waters for shelter as the weather deteriorated.  

Sea Watch on Sunday said that the situation aboard was deteriorating dramatically, with food and water running short and the migrants getting dehydrated and demoralised.

Watch: 'C'est fini'!' Migrants cheer as they hear the news

Malta had insisted that since the rescues did not take place in its area of competence, it should not be held responsible for the migrants.

As the days dragged on to weeks, calls for EU member states to resolve the matter grew louder and more frequent. On Sunday, Pope Francis made a clear appeal for solidarity. 

Talks to resolve the diplomatic stand-off were coordinated by the European Commission and involved all member states. 

On Wednesday, Dr Muscat acknowledged that the Maltese government had insisted on a relocation mechanism for the 249 migrants rescued by Malta to also feature as part of a deal to disembark and relocate the 49 stuck at sea. 

It would not have been fair, the Prime Minister argued, if the EU agreed to relocate migrants which a member state had refused to take responsibility for - a clear reference to Italy's position -  while not helping out when a government abided by its obligations. 

Photo: Matthew MirabelliPhoto: Matthew Mirabelli

Dr Muscat said the migrants on the two rescue ships will be transferred to AFM patrol boats and the two vessels will then be told to leave Maltese waters.

44 Bangladeshi migrants who were among the 249 rescued by Malta will be repatriated, with assistance by the EU.

Dr Muscat thanked the EU and those member states involved in the relation exercise for their solidarity. 

"Every hour that passed without a solution is not an hour I was proud of. The solution was not found by the EU, but by some EU members," Dr Muscat said.

Video: Matthew Mirabelli.

'No one asked them to come to Malta'

Asked whether the 49 migrants rescued by the NGOs were made to wait while an agreement was reached about the other 249, Dr Muscat replied: "To be very blunt, no one asked the two ships to come to Malta.

"When the rescue took place they were not next to Malta, but Libya. One argues that Libya is not a safe place, but they were next to two other safe places - Tunisia and Italy. Definitely not in Maltese waters, so I think it is unfair to say that someone was made to wait when no one asked them to come.

Read: Let the Libyan coast guard do its job, says Muscat

It is unfair to say that someone was made to wait when no one asked them to come- Prime Minister

"Secondly, it's not a free for all. There are rules and as a prime minister I cannot be expected to say yes to everything all the time. There are rules and from our side we wanted a clear political sign that adhering to the rules is appreciated. If you want to say that they were made to wait until a solution was reached, yes, but in the end we did not create the problem ourselves.

Asked to clarify a comment about NGOs creating problems, he said EU member states and NGOs both needed to abide by the rules. Member states could not refuse entry or rescue if it was within their responsibility, while on the other hand NGOs need to obey the orders of the competent authorities.

"If one goes amiss - either member states or NGOs try to do it themselves, then we are in for considerable problems in the next few months."

Salvini says he is opposed to deal

Italy’s hardline Home Affairs Minister Matteo Salvini immediately said he was opposed to the relocation deal, saying he had not been consulted about Italy taking in a number of the migrants.

“Whether there are eight or 88, I’m not authorising anyone to enter Italy,” he said from Poland, where he is meeting his Polish counterpart.

“This won’t spell the end of the government, but I expect immediate clarifications. These sorts of decisions require consultation before they’re taken. I don’t understand why [Prime Minister Giuseppe] Conte rushed this,” La Repubblica quoted Mr Salvini as saying.

The Sea Watch 3 outside Għadira. Photo: Mark John Vella BardonThe Sea Watch 3 outside Għadira. Photo: Mark John Vella Bardon

NGOs welcome resolution

In a joint statement, 62 NGOs welcomed the disembarkation decision.

"We also appreciate the solidarity expressed by other Member States and institutions of the European Union, in agreeing to share the responsibility of hosting the rescued migrants. Such sharing of responsibilities is essential if the EU is to deal effectively with forced migration in a manner that is fair and respectful of fundamental human rights," they said.

They said all the migrants should be granted full access to asylum procedures so they would be able to get the protection that they needed.

They also hoped that the situation seen over the past days would not be repeated  and that respect for life and human dignity would remain at
the heart of Malta’s approach towards refugees and migrants.

Adrian Delia satisfied 49 lives have been spared

In a short video comment to the Nationalist Party’s NET News shortly after Dr Muscat’s press conference, Opposition leader Adrian Delia said he was satisfied that 49 human lives had been spared.

The PN had been following this case closely and had even raised the matter at EU level through its political grouping the European People’s Party.

Dr Delia said he had also repeatedly raised the issue in recent months when travelling to Brussels and at other summits and political gatherings.

Bishops appreciate solidarity 'finally' shown with stranded migrants

The bishops of Malta and Gozo expressed their appreciation to the Maltese government, the European Commission and the eight European countries for the solidarity they “finally” showed with the 49 stranded migrants.

“We are also grateful to all the organisations that have promoted concrete solidarity with the people involved. We recognise that Malta, the smallest EU member state, was neither the responsible authority nor the nearest port of safety when these migrants were rescued, and laud the efforts made by all parties involved to ensure that human life prevails over every other interest.”

The bishops joined Dr Muscat in thanking the European Commission for providing a solution for this crisis by coordinating the initiative of the relocation of migrants, including the 249 persons rescued at sea by the Armed Forces of Malta.

Human Rights Commissioner relieved

Council of Europe Commissioner for Human Rights, Dunja Mijatović also expressed relief that the situation has been resolved and listed issues which states had to tackle to prevent a reoccurence of the situation. 

UNCHR welcomes deal

The UN refugee agency, UNHCR, also welcomed the news and commended the EU member states which had agreed to relocate migrants. 

It nevertheless expressed concern that it had taken so long to come up with a solution.

"The imperative to save lives comes above politics and cannot be a responsibility that’s negotiated on a case by case basis,” said UN High Commissioner for Refugees Filippo Grandi.