ROME -- Spain stepped in as a safe refuge on Monday after Italy and Malta dug in for a second day and refused to let a rescue ship with 629 people aboard dock in their ports, leaving the migrants at sea as a diplomatic standoff escalated under Italy's new anti-immigrant government. "Enough!" said Italian Interior Minister Matteo Salvini. "Saving lives is a duty, but transforming Italy into an enormous refugee camp isn't."

He tweeted: #Chiudiamoiporti. "We're closing the ports."

Maltese Premier Joseph Muscat also refused to take in the "Aquarius" ship of the humanitarian group SOS Mediterranee. He accused Italy, which coordinated the rescue, of violating international norms governing sea rescues.

Get Breaking News Delivered to Your Inbox

Spain's government confirmed hours later that the Aquarius would be allowed to dock in the southeastern city of Valencia.

Italy's position, Muscat said, risks "creating a dangerous situation for all those involved."

The mayors of Valencia and Barcelona in Spain offered their ports on Monday to receive the charity-run rescue ship, with Barcelona Mayor Ada Colau chastizing her European counterparts and saying the crisis "puts in question" the unity of the European Union. She said "the duty of a democratic government is not to look away" in a humanitarian crisis.

Colau has also called on the new Spanish government, now led by the Socialist party, to change migration policies set by the previous conservative administration.

As the rhetoric intensified earlier between Italy and Malta, the Aquarius remained on standby in the Mediterranean Sea with its 629 passengers, including 123 unaccompanied minors and seven pregnant women. The ship said it had been ordered by Italy's coast guard coordination center late Sunday to remain 35 miles off Italy and 27 miles from Malta.

🔴 UPDATE The #Aquarius remains instructed to standby between #Italy and #Malta. The 629 rescued people’s conditions are stable but risk worsening over the day. They are becoming more anxious & asking when they will be able to reach shore. pic.twitter.com/lipr2bqwgE — SOS MEDITERRANEE GER (@SOSMedGermany) June 11, 2018

The migrants had been rescued during a series of operations Saturday by Italian maritime ships, cargo vessels and the Aquarius itself. All passengers were offloaded to the Aquarius to be taken to land.

Doctors Without Borders, which has staff aboard the Aquarius, tweeted a video of some of the women aboard the ship praying Monday morning and said they were unaware of the diplomatic drama being waged on land over their fate.

"Thank you Lord," the women sang. The group said it "urgently requests a swift resolution and a designated port of safety."

The standoff marked the first inevitable clash over migrant rescues with League leader Salvini, now running Italy's interior ministry. Salvini campaigned on an anti-immigrant platform that also included a vow to expel hundreds of thousands of migrants already in Italy, even though experts doubt such mass deportations are feasible or financially viable.

Malta, for its part, has consistently refused to take in migrants, citing its small size and limited capacities.

The island nation has progressively reduced the number of migrants it has taken in over the past decade, from a high of 2,775 in 2008 to just 23 last year, according to U.N. statistics.

Salvini pointed to Malta's unwillingness in accusing Europe as a whole of leaving Italy on its own to deal with the refugee crisis. He noted that other European countries are very much involved in current rescue operations in the Mediterranean -- including a German aid group currently off Libya -- but no country is stepping up to actually take in the migrants. That was before Spain stepped up.

"Italy has stopped bowing our heads and obeying," Salvini said in a Facebook post. "This time we say no."

The standoff was actually the third in recent weeks, after the outgoing government of Premier Paolo Gentiloni refused to let humanitarian aid groups dock in Italian ports until the ships' flag nations had formally requested permission. Those incidents delayed the migrants' arrival, but they ultimately made it to Italy.