VALLETTA, Malta -- Racing an approaching storm, Maltese military vessels took to shore 49 migrants who were kept in limbo on private rescue ships until the island nation reached a deal Wednesday for the asylum-seekers to be distributed among eight other European Union members.
The deal ended an impasse that kept the migrants stuck on the rescue boats while European governments negotiated which countries would take them. A ship operated by German rescue group Sea-Watch picked up 32 people on Dec. 22. Another aid group, Sea-Eye, rescued 17 in waters off Libya on Dec. 29.
"After 19 days at sea, our guests finally have a safe haven," a tweet from Sea-Watch's account read. "It is a testament to state failure; politics should never be played at the cost of people in need."
When the deal was announced, the aid boats were about 5 nautical miles off the coast of Malta, which denied them permission to port but let the vessels shelter in its territorial waters for days.
The Maltese government continued to deny the boats permission to dock, but arranged for the 49 migrants to be transferred to the military vessels offshore and then brought to the island nation.
Upon their arrival not long before the storm whipped up the sea, many of them waved and cheered at cameras recording the event. One man formed the shape of a heart with his hands as he stepped off a military boat.
Maltese Prime Minister Joseph Muscat said the ad hoc deal illustrated anew that the EU needs a comprehensive policy on migrants who are rescued while trying to reach Europe by crossing the Mediterranean Sea.
"I think it is obvious that we need something more structured and long-term," he told reporters. "However, right now, I think it would be delusional to think that there is the political climate for this to happen."
The deal also met Malta's demand for other countries to take many of the 249 migrants Maltese military vessels rescued in late December. The agreement calls for 131 to be relocated to other EU nations, 74 to remain in Malta and to have EU experts review the circumstances of 44 migrants from Bangladesh before their destinations are decided.
Germany agreed to take 60 migrants from Malta, some from the stranded rescue ships and some Maltese boats rescued in December. Italy was another of the eight countries that agreed to let in migrants from the Sea-Watch and Sea-Eye ships.
The other countries in the deal are France, Italy, Portugal, Ireland, Romania, Luxembourg and the Netherlands.
Like Malta, Italy has refused to let private aid vessels dock in its ports since last year. The latest standoff at sea sharply divided the partners in Italy's populist government, the right-wing League party and the euroskeptic 5-Star Movement.
Italian Premier Giuseppe Conte had said Italy was willing to receive 15 children and their parents, but Deputy Premier Matteo Salvini, Italy's anti-migrant interior minister, reacted angrily to Malta's announcement of a deal.
"I am and remain absolutely contrary to new arrivals in Italy," he said.
At EU headquarters in Brussels, "they pretend to not understand and facilitate the work of (migrant) smugglers and NGOs," Salvini said.
"To give in to the pressures and the threats of Europe and NGOs is a signal of weakness that Italians don't deserve," he added in a possible jab at Conte and the leader of the 5-Star Movement.
Aggravating tensions within the coalition government, Salvini later declared that he would disregard Italy's consent to the deal and refuse to let any of the 49 migrants into the country. It was unclear if he would follow through in defiance of Conte.
Salvini was in Warsaw on Wednesday for meetings with officials from Poland's government, which refused to accept any of the 49 migrants. He has been pushing for far-right political parties and sovereignty-advocating movements like his League to join forces for European Parliament elections in May and the chance to steer EU policy on immigration.
The migrants at the center of the EU-brokered deal are among the waves of people from Africa, Asia and the Middle East who fled poverty and armed conflicts and risked their lives aboard smugglers' boats bound for Europe in recent years.
Police in Spain said Wednesday they broke up a gang that allegedly smuggled people and drugs on boats from Morocco and charged migrants up to 2,000 euros ($2,300) a trip.
The number of migrants reaching Spain by sea has surged amid Italy's refusal to let private rescue vessels into its ports. European Union border agency Frontex says about 57,000 migrant crossings were detected last year in Spain, twice as many as during 2017.
Frances D'Emilio reported from Rome. AP writers David Rising and Geir Moulson in Berlin and Barry Hatton in Lisbon, Portugal, contributed to this report.