The 630 migrants whose rescue sparked a major migration row in Europe arrived in the Spanish port of Valencia on Sunday after a turbulent week that saw Italy and Malta turn them away.
The Aquarius, which has been at the centre of the crisis, sailed into Valencia harbour about 10:30 am (0830 GMT) with 106 migrants on board to applause from police, health workers and translators waiting on the pier.
Under blue skies, migrants danced and sang, their excitement captured in footage released on Twitter by SOS Mediterranee which operates the rescue vessel with Doctors Without Borders (MSF).
The remaining migrants arrived on an Italian coastguard ship, the Datillo, and an Italian navy vessel, the Orione. They had been transferred from the Aquarius to make the voyage safer and more comfortable.
Medical staff wearing white overalls, gloves and masks went on board the three ships to carry out initial checks before the migrants disembarked in groups of 20.
They were welcomed by a team of more than 2,000 people, including 470 translators and 1,000 Red Cross volunteers who distributed blankets, clothes and hygiene kits
High waves and winds had forced the convoy to take a detour on its 1,500-kilometre (930-mile) voyage to Spain.
"It is the end of a far too long voyage," said the head of MSF Spain, David Noguera, adding he was happy that they migrants had finally arrived in a "safe place".
At the port, a huge banner was hung up saying "Welcome home" in various languages including Arabic.
"Today is a historic day...there will be a before and after," said Father Angel Garcia Rodriguez, a priest who heads the Messengers of Peace NGO which is helping migrants at the port.
Among the passengers are 450 men and 80 women -- at least seven of them pregnant -- as well as 89 adolescents and 11 children under the age of 13, figures released by the Valencian authorities show.
They come from 26 countries, mainly from Africa but also Afghanistan, Bangladesh and Pakistan, MSF said.
Those with injuries -- mainly scratches and burns -- were taken to hospital along with the pregnant woman, health officials said.
The Aquarius rescued the migrants off Libya's coast last weekend but Italy's new populist government and Malta both refused to let it dock, accusing each other of failing to meet their humanitarian and EU commitments.
Spain eventually stepped in and agreed to receive the refugees as a "political gesture" to "oblige Europe to forge a common policy to a common problem," Foreign Minister Josep Borrell said.
Madrid on Saturday said it had accepted an offer from France -- who had angered Rome by branding it irresponsible -- to welcome Aquarius migrants who "meet the criteria for asylum".
Prime Minister Pedro Sanchez thanked French President Emmanuel Macron for his gesture, saying it was "exactly the kind of cooperation Europe needs" at this hour.
The plight of the Aquarius has again highlighted the failure of EU member states to work together to deal with the influx of migrants since 2015.
After Rome's decision to ban the Aquarius, Macron and Italian premier Giuseppe Conte met Friday and called for the EU to set up asylum processing centres in Africa to prevent "voyages of death".
They also demanded "profound" changes to the EU asylum rules which put the migrant burden on their country of entry to Europe -- mainly Italy and Greece.
And on Sunday he said he criticised other EU nations for not taking their fair share of refugees, and hoped Spain would "receive 66,000 other (migrants) and that the Portuguese, the Maltese and others could also receive them".
However, 42 migrants rescued this week by a US ship off Libya before being transferred to an Italian coastguard vessel already carrying 500 migrants would be allowed to land in Italy, media reported in Rome on Sunday.
The USS Trenton also picked up 12 dead bodies during the rescue.
MSF emergency coordinator Karline Kleijer said "nothing justifies the degrading treatment" Italy "inflicted" on the passengers of the Aquarius, adding it was "scandalous" that they were made to "wander at sea unnecessarily".
Nearly 1,000 migrants arrived Friday and Saturday in the south of Spain, the third busiest gateway for migrants into Europe after Italy and Greece.