The small 15-metre boat landed on the southern Italian island of Lampedusa with 271 survivors onboard.
In the engine room however they found the the bodies of 25 men who appeared to have died from asphyxiation.
Lampedusa has had thousands of North African refugees turn up in recent weeks.
The coastguard boarded the boat at around 01:20 on Monday as it neared Lampedusa and discovered the bodies.
Italian media reports that the people in the engine room had apparently tried to escape but had been trapped by the numbers on board and probably been choked by engine fumes.
The engine room was only accessible through a 50-centimetre wide trap door from the deck, an official said.
Italian investigators say that as some of the corpses had already begun decomposing then they probably died while the boat was in international waters.
“Given the state in which the corpses were found, they could have been dead for at least 48 hours,” doctor Pietro Bartolo told reporters. Survivors said they had been at sea for three days.
Most of the dead are believed to be foreign workers from countries including Somalia, Nigeria and Ghana who are fleeing the war in Libya. An estimated 250 refugees drowned when their boat capsized off the island in April.
It is estimated that one in ten refugees die on the way to Italy. We in the West find it easy to judge these deperate people, yet we have not experienced what they have. To consider the strong possibility of death as a legitimate alternative to violence, poverty and oppression is not place most of us have ever found ourselves.