MESSINA, Sicily (AP) _ A court Friday convicted 65 people and acquitted 180 after a yearlong Mafia trial during which a lawyer and five defendants were killed.

After 16 days of deliberations, the court convicted 40 people of criminal association and 25 others of criminal Mafia association. All were found innocent of drug trafficking charges.

Among those convicted were three reputed heads of local Mafia families: Gaetano Costa, sentenced to 13 years, and Placido Cariolo and Carmelo Milone, each sentenced to six years.

Costa received the stiffest prison sentence, and the lightest prison terms were four years.

Five defendants who were free on bail during the trial were gunned down in what police said were vendetta slayings between rival gangs. A sixth committed suicide and another died of a heroin overdose.

Lawyer Nino D'Uva, who was representing 22 defendants, was shot dead in his office a few days after the trial began in April 1986.

The key prosecution witness in the trial was Giuseppe Insolito, 28. He testified that four Mafia families were involved in drug trafficking, robbery, prostitution and extortion in Messina.

Three days before he was to testify, his father was shot and wounded in what authorities said was an attempt to intimidate the witness.

The Messina trial is separate from the trial of 474 Mafia suspects conducted in Palermo, Sicily, since February 1986.

Among the defendants in that trial is Michele ''the Pope'' Greco, described as the head of the Mafia organization controlling the Sicily-U.S. heroin trade.