DEWITT, N.Y. (AP) _ Murder charges were filed Wednesday against a prisoner who, despite being manacled, wrestled a gun away from a sheriff's deputy, witnesses said, and shot the deputy and another officer.

Authorities charged William R. Blake Jr., 23, of Syracuse, with murdering Onondaga County Deputy David R. Clark, 33, and with attempted murder in the wounding of Deputy Bernard J. Meleski, 47.

The shootings took place in the DeWitt municipal building as the two officers were escorting Blake and two other prisoners from court appearances, said Sheriff's Department spokesman Bob Burns. The other two prisoners were considered witnesses to the shooting, not suspects, said Burns.

''I looked up and saw one of the deputies scuffling with Blake,'' Scott Stauchurski, one of the prisoners, told police in a handwritten statement.

Attorney James Greenwald, who was representing John Johnson, the other prisoner, said he was standing several feet away when the first shots were fired. He said the gun apparently was taken away from Meleski, a 17-year veteran, during the struggle. Police have not said whose service revolver was fired.

Greenwald said nothing unusual had transpired in the 10 minutes the deputies and the prisoners were in court.

Stauchurski, who along with Blake was handcuffed to Johnson, told police he heard two shots fired during the scuffle.

''Somehow Blake jerked himself free, and then he pointed the gun at Bernie's stomach and fired the weapon once,'' Stauchurski said.

''The other deputy had backed up a little, I think to draw his gun. Blake pointed the gun at his stomach and fired once. Blake just stood there, and then he looked at me and pointed the gun at me. Then he said, 'Come on, I'm getting out of here,'' said Stauchurski.

Blake began to lead the two other prisoners into the parking lot, but then returned to the injured officers to get the key to the handcuffs, Stauchurski said. When he did not find the keys, Blake tried to shoot off the handcuffs, but failed, Stauchurski said.

Blake then began pulling the other two prisoners back into the parking lot, threatening to shoot them, said Stauchurski.

''He started running, half dragging me and Johnson into the parking lot,'' he said.

In the parking lot, the prisoners encountered two more deputies, and Blake surrendered without resistance.

''After we were taken into custody, and we were lying on the ground, I heard Blake say, 'I hope both deputies die,''' Stauchurski told police.

Clark, of Salina, died from an abdominal wound about 3 1/2 hours later at a hospital. Meleski, of Manlius, was hospitalized in serious condition, with gunshot wounds in the chest and an arm.

DeWitt police had arrested Blake Friday on narcotics charges. He later was charged in connection with a Feb. 2 armed robbery of a Brooklyn man at a motel in Salina.