In the second major maritime drama of recent days, officers revealed that the huge cargo ship's engine had been locked on with the steering set on a direction that would have led to it crashing ashore in the Puglia region on the "heel" of Italy.
The coastguard, already working flat out because of the Norman Atlantic ferry disaster, scrambled two helicopters overnight after realising that the Moldovan-registered Blue Sky M, was headed for the rocks.
Six officers boarded the vessel and, after some frantic moments on the bridge, were able to unlock the engines and bring the boat under control just five miles (eight kilometres) from the coast.
"It was a real race against the clock," coastguard spokesman Filippo Marini said. "Unlocking the engines was a difficult and delicate operation, but they managed to do it."
In a tweet from its official account, the coastguard said a "massacre" had been avoided.
The coastguard later put the number of migrants on board at 768, revising downwards their earlier estimates of more than 900.
The migrants were said by local officials to be almost all Syrians and their number included a heavily pregnant woman whose waters broke during the drama and some 40 children.
As they were being processed in the port of Gallipoli, an inquest began into how the alarming incident had occurred.
It was unclear where the Syrians had boarded the boat but its last port call was at Korfez in Turkey on December 14, according to tracking website www.marinetraffic.com
Greece's coastguard had on Tuesday received a distress call from someone on board the Blue Sky M who reported that it was being navigated by heavily armed men.
A navy frigate, a helicopter and two patrol vessels were dispatched to intercept the boat off the island of Corfu.
But Greek officials admitted Wednesday that the checking of the vessel had been cursory at best.
"The coastguard contacted the captain of the ship, who said there was no problem on board," a coastguard source told AFP.
Signup to our newsletter and follow us on Facebook and Twitter!
"A navy frigate escorted the vessel briefly in Greek waters until it reached international waters and headed for Italy."
Officially the boat was travelling from Greece to Croatia but it remained unclear where the migrants had been
Italian officials suspect the "captain" who reassured the Greeks nothing was amiss was in fact the leader of a group of people smugglers who later jumped ship, as they frequently do in the knowledge that their human cargo will be picked up by navy or merchant ships.
One man suspected of involvement with the traffickers was arrested after the boat arrived in Gallipoli.
CONFLICT AND POVERTY
The drama came as Italy and Greece were coping with the aftermath of the Norman Atlantic disaster, which has left at least 13 people dead and dozens more unaccounted for.
The Italian-owned, Greek-operated ferry remained off Albania Wednesday with continuing bad weather preventing it being towed back to Italy.
The cause of a killer blaze that erupted on the ferry on Sunday remained unknown. Criminal probes into what happened have been opened in Italy and Greece.
Survivors who waited up to 24 hours to be rescued from the burning ship have highlighted major shortcomings in the crew's response to the emergency.
Doubts over the accuracy of the passenger list have hampered attempts to establish the true scale of the tragedy.
The prosecutor in charge of the Italian investigation has said he expects to find more bodies aboard the burnt-out ferry, which was carrying an unknown number of stowaways and more than 400 passengers and crew.
Three stowaways who were rescued, two Afghans and a Syrian, have requested political asylum.
It is feared some passengers may have died in cabins that were engulfed in smoke early in the incident.
An unknown number reported by witnesses to have made it into a lifeboat have not been accounted for.
Italy's coastguard has vast experience in rescuing boat people fleeing conflict or poverty in the Middle East, Africa and Asia.
More than 170,000 have landed in Italy this year and hundreds, possibly thousands, more have perished at sea while attempting the crossing.
With the onset of winter, traffickers have switched to using bigger boats like the Blue Sky M, rather than the converted fishing boats and dinghies they previously deployed.