Malta followed suit, denying them entry, before Spain stepped in on Monday to say it would allow the ship to enter the eastern port of Valencia.

The migrants were then divided among three vessels: the Aquarius, an Italian Coast Guard vessel and another ship from the Italian Navy. They were more than 760 nautical miles from the port of Valencia. Some 106 people remained on the Aquarius, according to Aloys Vimard, project coordinator for Doctors Without Borders aboard the ship.

The disagreements in Europe weren’t all that stood in the way of the migrants reaching port: Stormy weather on Thursday caused further delays as the ship changed course. By Friday, it was headed toward its destination but had taken a longer route, past the Italian island of Sardinia.

“People are exhausted and really unwell after six days at sea in rough weather,” Mr. Vimard said during a telephone interview, describing how many were seasick for days. “It’s heartbreaking to see these people who were pushed away from Italy’s shores to this unnecessarily prolonged journey. They are in such a difficult situation.”

Those running the rescue operations are also concerned that the ship’s prolonged assignment is harming efforts to aid other migrants in distress in the well-traveled route between Libya and Italy.

“We are not on a cruise here — it’s an emergency lifesaving search and rescue boat,” Mr. Vimard said. “We are away from the main area when there are very few resources available for rescue.”