NEW YORK (AP) — A judge on Wednesday threw out man­slaughter charges against a New York Police Department officer accused of killing an unarmed man at his home as his grandmother stood nearby in a ruling that prompted a courtroom outburst by the victim’s mother and a vow by prosecutors to still pursue the case.

Constance Malcolm cursed and screamed, “They killed my child!” as it became clear that the judge was about to rule in favor of Officer Richard Haste. Court officers immediately removed her.

When order was restored, Judge Steven Barrett told spectators, “I regret that there are people who are hurt by this,” but he insisted that a flawed grand jury presentation by prosecutors left him no choice.

As Haste left the courtroom, protesters yelled, “Murderer!” The officer did not speak to reporters.

Haste had been charged in the fatal shooting of 18-year-old Ramarley Graham during a police operation targeting street corner drug dealing in the Bronx. He and other officers chased Graham into his family’s apartment, where the teen was shot at close range.

The victim was struck in the upper chest and collapsed inside a bathroom as his grandmother and younger brother stood nearby. No gun was recovered.

The judge ruled Wednesday that prosecutors, in giving instructions to grand jurors, had improperly left the impression the jury shouldn’t consider testimony by other officers that they radioed Haste in advance to warn him that they thought Graham had a pistol.

Haste testified in the grand jury that the radio transmissions convinced him Graham was armed and dangerous when he shot him in the chest. Jurors also heard evidence that Haste yelled, “Gun! Gun!” as a warning to other officers before opening fire.

“In effect, the grand jury was told communications of other officers were not relevant,” the judge said. “With no great pleasure, I’m obliged in this case to dismiss the charges.”

The judge stress­ed that he didn’t believe prosecutors deliberately misled the grand jury and he wouldn’t bar them from seeking another indictment.

Prosecutors said in a statement that they would appeal the decision or present the case again to the grand jury.

“It cannot be said more forcefully that we disagree with the court,” the statement said.

The Rev. Al Sharpton, who has worked with Graham’s family, called the judge’s decision “an outrageous miscarriage of justice and an insult to the family and supporters of Ramarley Graham.” Graham’s parents called for street protests.

But Patrick Lynch, president of the Patrolmen’s Benevolent Asso­ciation, said the judge’s ruling was the right one.

“We believe the judge made a difficult but correct decision,” Lynch said.