Malta has reached a deal with eight EU countries to divide up and take in 49 migrants stranded at sea for weeks.
PM Joseph Muscat named them as Germany, France, Portugal, Ireland, Romania, Luxembourg, the Netherlands and Italy.
The deal means the 49 migrants, who have been stranded on charity-run boats amid a row over who would take them, can now disembark in Malta.
The deal also decides the future of another 249 rescued migrants already in the island nation.
The 49 migrants were on two ships refused permission to dock by both Italy and Malta.
Thirty-two people were picked up off Libya on 22 December by the Dutch-registered vessel Sea Watch 3, operated by a German humanitarian group, while the Sea-Eye – a second ship run by a different German charity – rescued another 17 people on 29 December.
The situation on board both ships was said in recent days to be deteriorating, with food and water running short.
Pope Francis, at the weekend, appealed to European leaders to show “concrete solidarity” and give the migrants “a safe port”.
Mr Muscat welcomed the show of “solidarity and understanding” shown by the European Union nations, and said the transfer of migrants to the eight other countries would begin as soon as possible.
He again defended his decision to refuse to let the ships dock, although Malta had allowed them to enter its waters for supplies and to shelter from bad weather.
The migrants had been picked up off the coast of Libya and were not in Maltese territorial waters, he pointed out.
“Malta is a very small country,” he said. “It is in our nature to assist those in distress but as prime minister I cannot shirk responsibility of safeguarding our national security and national interest.”
Malta will take in 78 of the 298 migrants itself.
Another 176 will be relocated within the other eight EU nations and 44 will be repatriated to Bangladesh.
Pressure on Malta to take rescued migrants has increased since Italy’s populist government began turning them away on assuming power more than six months ago.
Italy’s government appeared divided on the latest decision. Prime Minister Guiseppe Conte offered to take in some of Malta’s migrants, saying there was a limit to the policy of “rigour”.
But Interior Minister Matteo Salvini, of the right-wing League party, said the decision by the EU countries was “facilitating the work of smugglers and NGOs”.
“I am and will remain absolutely against new arrivals in Italy… Giving in to the pressures and threats of Europe and NGOs is a sign of weakness,” he said.