Hundreds of migrants escaping violence and poverty in North Africa are due to arrive in Spain on Sunday. They're aboard the Aquarius -- a former German Coast Guard ship now being used for humanitarian rescues.

On the rescue ship, women cradle babies, kids play games and people sleep -- waiting for their ship to reach land.

The migrants' tumultuous journey began last weekend, when they left Libya for Europe crammed onto inflatable boats. When heavy winds tossed some passengers into the sea, rescuers intervened and saved 629 people.

"We were just, 'Go, go, go!'" said Max Avis, the deputy search and rescue chief of the Aquarius. "Trying to get lifejackets, throwing at them at the people as they fell."

Italy helped with the rescue operation, but the country's newly elected populist government refused to let the Aquarius dock on its shores. Malta said no too, exposing deep divisions over undocumented migrants fleeing to Europe.

"We have the most vulnerable of the vulnerable on the ship right now ... and they're being used to transport across the Mediterranean for some idiotic exercise of political influence. And these people are suffering," Avis said.

On Monday, came news that Spain would take the ship in. The migrants -- mostly from Africa -- will join roughly 37,000 others the U.N. says have reached European shores so far this year.

As the Aquarius prepares to arrive at Spain's eastern port of Valencia on Sunday, spirits on board are lifting, but human rights activists worry others won't be as lucky because this episode may have set a precedent of turning migrants away.

The U.N. says nearly 800 people have died or disappeared trying to cross the Mediterranean to get to Europe this year. EU leaders are set to discuss asylum rules at a summit at the end of this month.