A Bronx judge dismissed manslaughter charges on Wednesday against a New York City police officer who had shot and killed an unarmed 18-year-old in his family’s home.

The judge, Acting Justice Steven Barrett of State Supreme Court, found that the prosecution had given improper instructions to the grand jury that indicted the officer, Richard Haste. The Bronx district attorney’s office may appeal or try to bring new charges.

The judge ruled the grand jurors were not allowed to adequately consider evidence that Officer Haste had been warned before the shooting that the teenager, Ramarley Graham, might be armed. “With not great pleasure,” Justice Barrett said, “I’m obliged in this case to dismiss the charges.”

As the judge read his decision aloud, Mr. Graham’s family erupted in anger. His mother, Constance Malcolm, was removed from the courtroom as she shouted at the judge.