Story highlights

NEW: Italy's coast guard says there were 796 migrants aboard the ship

The crew had abandoned the freighter, which was cruising toward the rocky coast

Italian coast guard brought the freighter packed with migrants safely into port

Rome CNN  — 

It could have been, in the words of the Italian coast guard, a disaster.

But thanks to authorities, a ship on course to crash against the rocky Italian coast was stopped in time, saving passengers and averting a possible environmental catastrophe.

Italian coast guard commander Filippo Marini said the vessel was cruising on autopilot toward the coast at 6 nautical miles per hour. When it entered Italian search and rescue waters, the coast guard sent helicopters with six men, who boarded the ship and took control.

The course of the vessel was reversed to avoid a collision with the rocks, and it was piloted instead to Gallipoli, in Italy’s southern Puglia region. It docked safely there Wednesday.

The freighter carried 796 migrants, the coast guard said Thursday, most believed to be from war-torn Syria. Authorities on Wednesday put the number of migrants on board at 768.

The crew of the Blue Sky M apparently jumped ship.

The coast guard said a collision would not only have led to the deaths of passengers, but would also have created an environmental disaster. It said a “real disaster” was avoided.

The freighter sent a distress signal near the Greek island of Corfu on Tuesday, alerting Italian and Greek authorities to the situation on board.

The Greek Merchant Marine Ministry and the Greek Navy have said the pilot of a Greek helicopter that flew over the cargo ship spoke with the captain, who said the ship was not in distress and did not need assistance.

Floriana Segreto, a spokeswoman for the Italian coast guard in Rome, said there were no deaths related to the Blue Sky M incident. She added that about 100 people have been hospitalized, mainly because of the cold and exhaustion.

It was not immediately clear where the migrants will go.

The authorities will investigate what happened to the crew and how the freighter reached Italy’s waters.