VALLETTA (Reuters) - A military ship brought 58 migrants - and a dog - to Malta on Sunday, where they disembarked after spending several days waiting for seas to calm so they could be transferred from the charity rescue ship Aquarius.

Slideshow ( 10 images )

The migrants were rescued from two small boats off the coast of Libya at least a week ago. They include Libyans, Syrians, Palestinians, Somalis and Pakistanis. Among them are seven families and three children under five years of age.

The Aquarius spent five days off the coast of Malta waiting for the weather to improve so it could transfer the migrants to a Maltese cutter.

Panama withdrew the Aquarius’ registration amid the rescue operations, which means the ship will not legally be allowed to sail once it comes to shore until it sorts out its flag status. The Aquarius was the last charity rescue ship operating off of Libya. Last year there were five groups running rescue ships.

Among the migrants was a small, white dog, who was rescued along with her Libyan family. She was brought ashore in a carrier box and will be quarantined and examined before being returned to her family.

At a political event, Maltese Prime Minister Joseph Muscat said, referring to the dog, that his country cares about saving “all lives”.

France, Portugal, Spain and Germany struck a deal on Tuesday to take in the migrants who disembarked in Malta after Italy refused to let the vessel dock.

Some 650,000 people have reached Italian shores from North Africa since 2014, and Rome’s populist government, which took office in June, has begun to take a rigidly anti-immigration line, saying it will not let any more rescue ships dock unless other EU states agree to take the people in.

“The Government of Malta has participated in this effort on purely humanitarian grounds,” a Maltese government statement said. “The MV Aquarius has been deflagged and is expected to proceed to a port in France to rectify its stateless position.”

The United Nations’ refugee agency on Sunday thanked the countries involved in resolving the latest of several standoffs involving rescue ships and EU countries, all of which have arisen from Italy’s shutting of its ports.

“We are talking about people’s lives. Refugees and migrants cannot be continually put at risk while States argue over their responsibilities,” the U.N. High Commissioner for Refugees Filippo Grandi said in a statement.