VALENCIA, Spain — The Aquarius rescue ship, a pawn in Europe's latest battle over immigration, has docked in the Spanish port of Valencia after a weeklong odyssey carrying migrants around the Mediterranean Sea.

The boat operated by aid groups SOS Mediterranee Sea and Doctors Without Borders touched land early Sunday with 106 migrants onboard.

An Italian coast guard ship had already arrived in Valencia with 270 of the 630 total migrants that the Aquarius saved off Libyan shores over a week ago. Another Italian navy ship with the rest of the migrants from the Aquarius will arrive later.

The Aquarius was stuck off the coast of Sicily last Saturday when Italy refused it permission to dock and demanded that Malta do so. Malta also refused.

After days of bickering and food and water running low on the rescue ship, Spain stepped in and offered to grant the rescue boat entry some 930 miles away. The journey across the Mediterranean to Valencia took nearly a week.

David Noguera, the head of Doctors Without Borders in Spain, said he was glad that Spain allowed these migrants in but he's worried that more European nations will close their ports to those rescued at sea in the future.

"I have mixed feelings," he told The Associated Press on Sunday as the first boat arrived. "I am happy that the journey (for the Aquarius migrants) is over — a journey that was too long — and I am worried for the situation in the Mediterranean and the closing of European ports."

The migrants were met by emergency workers, health officials, Red Cross volunteers and psychologists at the city's marina. Each were assigned to a translator and authorities worked to determine their identities before they were sent to welcome centers.

The first person through the process was a 29-year-old man from South Sudan.

In total so far, there were 31 different nationalities represented, with the largest numbers of people coming from the Sudan, Algeria, Eritrea and Nigeria, according to Spanish authorities. There were also 68 minors, 46 of them traveling without an adult family member.

Valencia emergency official Jorge Suarez said some of the migrants were in a state of shock.

“They are very shaken,” Suarez said. “Put yourself in their position: you get off a ship and the first people who greet you are wearing masks.”

Physical exams did not reveal any serious health problems, but many passengers showed signs of exposure to high temperatures. A total of 144 were taken to hospitals for treatment of minor health issues.

David Beversluis, the chief Doctors Without Borders physician on the Aquarius, said several of the rescued women were victims of sexual violence and rape.

“The horrible stories that we hear from people who come out of Libya is gut-wrenching,” he said. “Spending time with people, listening to some of the torturous situations that they’ve been through, was really one of the most challenging parts of the entire operation.”

Spanish authorities say they will examine the migrants case-by-case to see who may qualify for asylum.

Still, due to their ordeal, the migrants from the Aquarius will be granted a "special authorization" to remain in the country for one month before "they will be dealt with according to our laws, without exception," said Spain's minister of public works, Jose Luis Abalos.

"Spain will act with sensitivity and at the same time within the law, and with a message to Europe that it doesn't have an immigration policy up to the challenge at hand," he added.

Spain also accepted the French government's offer to take in those migrants who want to go to France "once they have fulfilled the protocols."

#LIVE from #Aquarius: nearly there. The 106 people on board are set to disembark in Valencia. pic.twitter.com/UyetxveYRD — Anelise Borges (@AnneliseBorges) June 17, 2018

The boatload of migrants that was forced to spend days crossing the western Mediterranean includes 123 unaccompanied minors, 11 children and as many as seven pregnant women. After Spain invited the Aquarius to dock, Italy sent the Dattilo and Orione to help transport the migrants.

The refusal by Italy and Malta to allow the Aquarius to enter their ports has reignited a continent-wide battle over how to handle immigration.

Under the E.U.'s asylum laws — currently the subject of a major political dispute and under revision — migrants must apply for asylum in the country where they first enter Europe. In practice, the policy has placed a heavy burden on Italy and Greece, where hundreds of thousands of asylum-seekers have arrived in recent years.

Spain's new Socialist government has taken up the cause of the migrants' plight to demonstrate its commitment to protecting human rights and respecting international law.

But overall, the European Union's 28 members have not agreed in the least how to handle the influx of refugees and migrants to Europe. The issue has put strong domestic pressure on German Chancellor Angela Merkel, created a spat between France and Italy, and prompted eastern nations like Hungary and Poland to refuse to take in any migrants.

Immigration will be a top issue at the E.U. leaders' June 28-29 summit, and a new populist government from Italy — one whose interior minister has vowed to deport tens of thousands of migrants as soon as he can — will make any compromise on migration policy even more difficult.

The arrival of the Aquarius convoy comes during a spike of desperate migrants heading to Europe from North African shores. Spain's maritime rescue service pulled 986 people from 69 small boats near the Strait of Gibraltar between Friday and Saturday, and also recovered four bodies.

Fleeing violent conflicts or extreme poverty, thousands of migrants attempt the dangerous journey into Europe each year in smugglers' dinghies.

At least 792 migrants have died crossing the Mediterranean so far this year, according to the United Nations. Through the first five months of 2018, some 35,455 migrants reached European shores, with 11,792 of them arriving in Spain.