Fifty-eight migrants and a dog will be transferred to four European nations in the coming days.

Maltese authorities have finally allowed 58 migrants off the Aquarius to Valletta after they waited for days in rough seas on the rescue ship that can no longer go to port after its flag was pulled.

The migrants, including Libyans, sub-Saharan Africans and Afghans, boarded two buses at a Malta Armed Forces base in Valletta on Sunday after being transferred from the Aquarius to a Maltese patrol boat in international waters.

“All migrants who disembarked in Malta will be transferred to four other European countries in the coming days,” the Government of Malta said in a statement.

The migrants include a five-month pregnant woman and Bella the dog, the first animal rescued with migrants in the Mediterranean and they are to be sent on to four European countries after a tense standoff over their fate last week.

VIDEO: Maltese coast guards bring back Aquarius migrants to Valletta as the civilian rescue ship is unable to return to port for fear of being impounded pic.twitter.com/IfJGtox3yI — AFP news agency (@AFP) September 30, 2018

The UN refugee agency UNHCR said that it had not yet been decided where which of the migrants – 18 children, 17 women, 23 men and a dog – would go.

“We hope that they will leave Malta in a few days,” UNHCR representative Paolo Biondi told AFP news agency at the base.

France has agreed to take 18 of the migrants, Germany and Spain 15 each and Portugal 10.

“The de-registration of the Aquarius is deeply worrying and would represent a dramatic reduction of search and rescue capacity at precisely the moment when it needs to be stepped up,” the UNHCR statement added.

Panama pulled its flag from the ship a week ago, meaning the unregistered Aquarius would not be able to leave any port, while other rescue vessels already impounded in Valletta fight a protracted legal battle.

Italy convinces Panama to revoke the flag of the rescue ship Aquarius, effectively stopping it and making it more likely that migrants will drown in the Mediterranean. Italy also illegally restricts the rights of asylum seekers who make it to its shores. https://t.co/x2qua4NCv2 pic.twitter.com/F9NeIxKVVo — Kenneth Roth (@KenRoth) September 30, 2018

The group were picked up from two boats plying the perilous route between North Africa and Europe last Monday.

The Aquarius, chartered by Doctors Without Borders (MSF) and SOS Mediterranee, is the only civilian ship still trying to rescue migrants making the perilous journey from North Africa to Europe.

“After five days waiting at sea near Malta, this morning all 58 rescued people on board the Aquarius will be transferred to the Maltese maritime authorities for disembarkation in Malta,” MSF wrote on Twitter.