MACHIAS, Maine (AP) — A Maine man accused of killing a man and leaving a bloody knife stuck in the wall near the body is being committed to the state for psychiatric care.

Spencer Weiner-Pool/Getty Images

A judge on Friday accepted Hazen McDugald's plea that he was not criminal responsible for the charge of manslaughter because of mental illness. He was committed indefinitely to Riverview Psychiatric Hospital.

Police say McDugald told an Eastport police officer on Sept. 10, 2015, that someone had mistaken sound from the movie "Halloween" on the television for real cries for help. He then fled the scene while the officer found the victim dead inside the home.

While detained, McDugald was charged with aggravated assault after being accused of attacking and knocking a corrections officer unconscious at the Washington County Jail.