The Blue Sky M, carrying 970 people, had been abandoned and left on autopilot by its crew, believed to be people traffickers.
Italian coastguards later brought it under control and safely docked it at the Italian port of Gallipoli.
The migrants, believed to be mainly Syrians and Kurds, have been taken to local schools and a gymnasium.
Thirty-five of them were taken to hospital, with some treated for hypothermia, Italian Red Cross spokeswoman Mimma Antonacci said.
“They [the migrants] are now in all the schools around Gallipoli and they are recording now and trying to find out the names, but we’re talking about Syrians,” she added.
The Italian Red Cross had previously said that four people were found dead on the ship. It later withdrew its report, and officials now say no-one is known to have died on the ship, Reuters reports.
The passengers of the Blue Sky M cargo ship have a strange, terrifying story to tell. Hundreds of migrants paid thousands of dollars each to smugglers to get them to Europe.
Mohammed from Iraq was one of the passengers. “One week we sleep in the ship,” he said in broken English. “[We] don’t have clean water, don’t have food, don’t have doctor… women, children all sick.”
It would appear that the smugglers left the ship’s controls on autopilot and then abandoned ship – leaving the Blue Sky M to head towards the Italian coast. The migrants inside the boat did not know what was going on.
“Inside the room,” continued Mohammed, “[We] don’t have any information about life or death.”
The coastguard boarded the ship, disengaged the autopilot and steered it to port. In Gallipoli, the refugees are now being cared for in local schools.
“It’s an emergency, a real emergency,” says rescue volunteer Federica Palumbo.
Ambulance crews stood waiting as the ship docked in the early hours of New Year’s Eve.
A local eyewitness in Gallipoli, Gilberto Busti, told the BBC World Service he had seen hundreds of people – who he thought could be Syrian and Kurdish refugees – disembarking from the vessel.
Italy has had to deal with a massive surge in migrants – many of them from the Middle East and the Horn of Africa – setting off on boats with hopes of reaching Europe.
The most common sea route for the clandestine voyages has been from Libya but this ship is said to have started in Turkey. It is also unusual to find a vessel of this size carrying migrants.
People traffickers who organise the crossings often abandon the vessels at sea to avoid arrest.
The Blue Sky is listed as a general cargo ship, flying under a Moldovan flag.
The safety manager of a company hired to provide safety certification for the ship told the BBC he had withdrawn its certificate several months ago after finding it unsafe.
Italian coast guard spokesman Filippo Marini was quoted by AP news agency as saying the Italians had averted a disaster by interrupting the programmed route that would have had the ship crash into the shore.
“It was a real race against the clock,” he said, adding: “Unlocking the engines was a difficult and delicate operation, but they managed to do it.”
Greek officials were first alerted to the ship when it was near Corfu.
A man aboard is reported to have asked for food, water and blankets. The distress call to Greek emergency services prompted the navy to send a helicopter and a warship.
The Greek authorities had said no-one aboard the vessel was in danger.
The Blue Sky M was reportedly heading for the port of Rijeka in Croatia from Turkey.
According to tracking website MarineTraffic, the ship abruptly changed direction south of Othonoi on Tuesday morning, heading west towards Italy.
Weather conditions in the Ionian sea have been poor for several days, hampering the rescue of those on board the Norman Atlantic ferry which caught fire in the area, killing at least 10 people.