ROME — The Italian police arrested two Libyans, two Algerians and a Tunisian on Friday in connection with a shipwreck that left at least 25 confirmed deaths and probably as many as 200.

The police in Palermo, Sicily, said the five men, ages 21 to 24, operated a rickety fishing boat, overloaded with about 600 migrants, that foundered and capsized off the Libyan coast on Wednesday. The five were charged with multiple homicides and human trafficking, the police said.

The charges were based on police interviews with dozens of survivors of the shipwreck, more than 360 of whom arrived in Palermo on Thursday. Survivors reported that the migrants on the boat were beaten during the journey and that many were locked in the hold of the vessel, the police said in a statement.

Based on survivors’ accounts, the police said that the vessel was three hours from shore when it began to take on water and that at first the migrants in the hold, mainly from Africa, were ordered to start bailing. When they realized that they could not keep up with the water flooding in, they tried to escape the hold.

“They were beaten with knives and canes and thrown back into the hull, and the hatch was sealed by the burden of the remaining migrants, who were placed there to prevent them from opening it,” the police statement said.

When an Irish naval ship tried to help, the boat capsized. The Italian authorities said that probably happened when the crowd of migrants on the deck saw the approaching ship and surged to one side of the fishing vessel.

Only 25 bodies have been recovered so far, but hundreds more migrants are missing and many are likely to have drowned. Many migrants attempting the illegal crossing cannot swim, and few have life jackets. Often, they are told by smugglers that the crossing will take only a few hours; in fact it can take up to two days.