The first of three ships transporting the group, an Italian coast guard vessel called the Datillo, pulled into Valencia harbour just before 6:30 am (0430 GMT) with 274 migrants on board, according to the Red Cross.
The Aquarius itself, the rescue ship chartered by a French NGO which has been at the centre of the crisis, pulled into port some four hours later under a clear blue sky at the port in southeastern Spain.
As it neared port, those on board had danced and sang, their excitement captured in footage released on Twitter by SOS Mediterranée which operates the vessel together with Doctors Without Borders (MSF).
The third boat, the Italian navy ship the Orione, was due to arrive by midday, regional authorities said.
After the first boat docked, medical staff wearing white overalls, gloves and masks went on board to carry out initial medical checks before the migrants disembarked in groups of 20.
The migrants, most of them from Africa, were welcomed by a team of more than 2,000 people, including 470 translators and 1,000 Red Cross volunteers who distributed basic items such as blankets, clothes and hygiene kits
High waves and winds had forced the naval convoy to take a detour on its 1,500-kilometre (930-mile) voyage to Spain, ending a week-long odyssey in the Mediterranean.
At the port, a huge banner was hung up saying “Welcome home” in various languages including Arabic.
“Today is a historic day,” said Father Angel Garcia Rodriguez, a well-known priest who heads the Messengers of Peace NGO which is helping migrants at the port. “It will be hard for Spaniards not to smile when they see these children disembark.”
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, local health officials said.
A French offer
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”.
Two countries will “work together” to handle the arrival, Spain's deputy prime minister Carmen Calvo said.
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.
'Voyages of death'
The plight of the Aquarius has again highlighted the failure of EU member states to work together to deal with the influx of migrant arrivals since 2015. After Rome's decision to ban the Aquarius, Macron and Italian premier
Giuseppe Conte met on Friday and agreed that the EU should set up asylum processing centres in Africa to prevent “voyages of death”.
They also demanded “profound” changes to the EU's asylum rules which put the migrant burden on their port of entry to Europe — mainly Italy and Greece.
Italy's far-right Interior Minister Matteo Salvini warned Saturday that other NGO operated rescue ships would also be banned from docking.
“While the Aquarius is sailing towards Spain, two other Dutch NGO operated vessels (Lifeline and Seefuchs) have arrived off the Libyan coast, to wait for their human cargos once the people smugglers abandon them,” Salvini wrote on Facebook.
“These people should know that Italy no longer wants to be any part of this business of clandestine immigration and they will have to look for other ports to go to,” he said.