The U.S. Navy has confirmed that one of its ships was involved in a rescue operation in the Mediterranean.

The U.S. Sixth Fleet, which is based in Naples, Italy, said in a brief statement to The Associated Press that the USNS Trenton on Tuesday "rendered assistance to mariners in distress that it encountered while conducting routine operations in the Mediterranean Sea."

It said 40 people were rescued and are being given food, water and medical care on board the ship. The Navy statement didn't say where the survivors would be taken but that "U.S. authorities are coordinating with our international partners to determine their ultimate disposition."

The incident was first reported by German migrant aid group Sea-Watch, which said 41 people were rescued and 12 bodies recovered during the operation.

Italy dispatched two ships Tuesday to help take 629 migrants stuck off its shores on the days-long voyage to Spain in what is forecast to be bad weather, after the new populist government refused them safe port in a dramatic bid to force Europe to share the burden of unrelenting arrivals.

The rescue ship Aquarius has been stuck since Saturday in international waters off the coast of Italy and Malta, both of which have denied it entry. The ship has 629 migrants including 123 unaccompanied minors, 11 children and six pregnant women.

The aid group Doctors Without Borders, which operates the Aquarius with SOS Mediterranee, urged both Italy and Malta to reconsider their refusal to allow the stranded migrants landfall and then safe passage by other means to Spain, which has responded to the plight with an offer of safe harbor. The aid group said the migrants were "exhausted and stressed" and warned of severe health risks to a number of the passengers during the 1,500-kilometer journey, expected to take three to four days.

Italy's new anti-migrant, right-wing interior minister, Matteo Salvini, is making good on a campaign pledge to close Italian ports to non-governmental organizations that pick up migrants at sea, which he has likened to taxi services for migrant smugglers.

Salvini, whose League is part of the populist coalition that took office this month, promised voters that other European countries would be made to share the burden of caring for asylum-seekers arriving in Italy on unseaworthy boats mostly from lawless Libya, while taking particular aim at the aid vessels.

"These are all foreign ships flying foreign flags that bring this human cargo to Italy," Salvini told private television La7 on Monday. "We have hosted 650,000 migrants in recent years alone, all of whom pass by Malta, an EU country, and the government says, 'Ciao, Ciao, go to Italy.' ... I am happy to have given a small, first response."

While Salvini turned away the Aquarius, an Italian Coast Guard vessel with more than 900 migrants rescued in seven operations is expected to reach Italy's shores on Wednesday.

Meanwhile, hundreds of migrants aboard the Aquarius were being transferred Tuesday afternoon to ships operated by the Italian navy and coast guard, which are then to accompany the aid ship to the Spanish port of Valencia. Many remained on the deck of the overcrowded rescue ship and their safety was at risk for the longer voyage given the forecast of bad weather, said SOS Mediterranee spokeswoman Mathilde Auvillain

Fresh provisions -- including 950 bottles of water, 800 boxes of noodles and snacks, blankets, hats and socks -- were delivered to the Aquarius on Tuesday, the charity said.

Officials in Valencia said they expected the ship to arrive in three to four days, depending on when they depart and weather conditions.

The emergency was prompting vastly different reactions in European capitals.

While Spain's foreign minister said he hoped its gesture of solidarity would help push other EU members to re-examine migrant policy at a summit later this month, French President Emmanuel Macron criticized Italy's cynicism and irresponsibility for leaving the migrants at sea, while also deflecting criticism for not allowing the ship to dock in France.

Macron's spokesman, Benjamin Grivaux said France doesn't want to "start a precedent" that would allow some European countries to breach international laws and rely on other EU member states. But he quoted Macron as telling Tuesday's weekly Cabinet meeting: "If any ship was closer to France's shores, it could obviously dock on the French coast."

Spanish Foreign Minister Joseph Borrel said late Monday that "Spain has made a gesture that aims to trigger a European dynamic to stop looking away, allowing one (EU member) to cope with the problem while the rest of us pass the buck."

The new Spanish foreign minister said the decision to offer a docking port in the eastern city of Valencia had been a "personal and direct" move by the country's new prime minister, the Socialist Pedro Sanchez.

Hungary's radically anti-immigrant prime minister praised Salvini's move. Viktor Orban said his initial reaction to the news was a sigh of "Finally!" He called it "a great moment which may finally bring changes in Europe's migration policies."

Many Spanish regions and cities have offered to provide long-term support to the migrants, said Valencia's regional vice president, Monica Oltra. The Red Cross was preparing shelter and medical assistance to meet immediate needs on their arrival.

Doctors without Borders expressed particular concern for patients who had been resuscitated and risked developing "significant pulmonary disease after swallowing sea water." Another 21 patients suffered severe chemical burns from exposure to sea water mixed with fuel, while others risk pneumonia and yet others need immediate surgery for orthopedic issues.

SOS Mediterannee also said that removing the Aquarius risked lives.

"People are still fleeing Libya while the Aquarius is away from the search and rescue area in the Central Mediterranean, where rescue capacities are already totally insufficient," the charity's vice president, Sophie Beau, said.

Online Public Information File

Viewers with disabilities can get assistance accessing this station's FCC Public Inspection File by contacting the station with the information listed below. Questions or concerns relating to the accessibility of the FCC's online public file system should be directed to the FCC at 888-225-5322, 888-835-5322 (TTY), or fccinfo@fcc.gov.