An Italian prosecutor has ordered the seizure of the Open Arms migrant ship and the evacuation of the migrants on board on to the island of Lampedusa, Italian media report.
It is thought some 100 migrants were left on board the Spanish rescue ship.
Italy had refused to allow them to leave the ship for nearly three weeks, though dozens of children and the sick had been taken ashore.
Earlier, about 10 migrants jumped off the ship, hoping to swim to the island.
The swimmers were picked up by the Italian Coastguard from Lampedusa.
Agrigento Prosecutor Luigi Patronaggio ordered the vessel be preventatively seized after inspecting the boat on Tuesday afternoon “given the difficult situation on board”, a judicial source quoted by the AFP news agency said.
The founder of the Open Arms charity which owns the ship welcomed the decision in a tweet: “After 19 days, we will disembark today in Lampedusa.
“The ship will be seized temporarily, but it is a cost that @openarms_fund assumes to ensure that people on board can be seen to. We consider it essential to prioritise [their] health and safety in this humanitarian emergency.”
Prior to the prosecutor’s decision, Spain had announced it was sending a vessel to Lampedusa to pick up those on board, but it would have taken three days to reach the island.
Far-right Interior Minister Matteo Salvini has taken a hard line on migration, closing Lampedusa to migrant rescue ships.
“Being firm is the only way to stop Italy from becoming Europe’s refugee camp again,” he tweeted earlier.
These latest developments come as Italy’s Prime Minister Giuseppe Conte resigned earlier, following a blistering attack on Mr Salvini, a coalition partner..
Mr Conte said Mr Salvini had been “irresponsible” in creating a new political crisis for Italy for “personal and party interests”.