Zakieya Avery will be sent to a maximum-security psychiatric hospital, not a prison, after a judge ruled she was criminally insane in the killing of two of her children. (N/A/Family Photo)

A Maryland judge ruled Thursday that Zakieya Avery, a 31-year-old woman who called herself a demon assassin, was criminally insane when she killed her two youngest children in 2014 during what she believed was an exorcism.

The ruling — holding that Avery was not criminally responsible for the attacks — means that she will be sent to a maximum-security psychiatric hospital, not a prison.

Avery showed little emotion after the finding and did not look up as she was led out of the Montgomery County courtroom.

Several family members in attendance expressed visible relief. “It is bittersweet,” Kaliha Brooks said afterward. “We still lost the children. But we are happy to know my cousin will get the help she needs.”

On Monday, Avery admitted in court that she killed her 18-month-old son, Norell, and 2-year-old daughter, Zyana, and tried to kill her 5-year-old daughter, Taniya, and 8-year-old son, Martello.

On Monday, a defense attorney for Zakieya Avery played this video in a Maryland courtroom, hoping to bolster his argument that in 2014, when Avery killed her two youngest children during a bloody exorcism, she was insane. (Montgomery County State's Attorney's Office)

The horrifying violence — carried out in the early hours of Jan. 17, 2014, in a Germantown townhouse by Avery and her roommate, Monifa Sanford — drew national attention. The women attacked the children with a serrated paring knife, stabbing the youngest more than 20 times, because they thought the killings would cleanse the children of demons and send them to heaven.

Avery, who has a history of mental health issues, put forward a defense through her attorney this week that she was not criminally responsible at the time of the attacks, leading to the bench trial over whether she was criminally insane.

“Her mission and plan were quite convoluted, disjointed and elaborate,” Montgomery County Circuit Court Judge Terrence McGann said Thursday. “I find her statements inconsistent with a rational brain.”

“The inescapable conclusion I draw,” he added, “is that she believed she was providing for her children’s salvation. What rational normal-thinking human being could possibly conclude that their children would be better off dead than alive?”

Under Maryland law, Avery could be released from a psychiatric hospital if she is deemed to not be a risk to herself or to others. McGann seemed leery of such a move, noting that about a month before the crimes, Avery quit taking her psychiatric medication — apparently because she thought God had cured her.

“Someday the defendant will be asking this court to release her from a psychiatric institution,” McGann said. “If the only guarantee this court has that Ms. Avery won’t slaughter other children in the future is her compliance with a strict regimen of anti-psychotic medication, I don’t foresee that day when this member of the court will take that risk.”

After police took Avery and Sanford into custody on the day of the attacks, the women spoke openly about their beliefs in demons and exorcisms — statements that were at the core of mental health issues that had to be sorted in their cases.

Later in 2014, each woman was evaluated independently at the state’s Clifton T. Perkins forensic psychiatric hospital in Jessup. The big legal questions turned on what their mental state was at the time of the crimes. Were they so delusional they didn’t know their actions were wrong? And was their mental illness so severe that it overran any rational thoughts, leaving it impossible for the women to “conform” their conduct “to the requirements of law.”

The state doctors concluded that the answer for Sanford on both fronts was yes. They designated her “not criminally responsible.” A Montgomery judge agreed at a hearing in January 2015 and ordered Sanford’s confinement at Perkins.

But the doctors reached a different conclusion on Avery, saying that she knew what she did was illegal because, among other factors, she took steps to evade consequences — by running out the back of her townhouse — after the crime.

But Avery’s attorney, Brian Shefferman, challenged that opinion and retained two defense experts.

“The only way to understand her actions in this case is to factor in her mental illness, her delusional belief that her children were being possessed by demons,” one of those experts, psychiatrist Neil Blumberg, testified in court. “She clearly at the time thought that this was the proper and moral thing to do.”

“It’s a tragic case,” Shefferman said after the judge’s ruling Thursday. “I think the judge made the right call. She belongs in a hospital, not a prison.”

McGann spoke from the bench for 20 minutes — outlining Maryland’s criminal insanity statutes, Avery’s past mental illness, her descent into complete madness, and the brutality she and Sanford showed in the killings.

Arriving at a legal insanity ruling is a two-step process in Maryland, McGann noted. First, the courts must determine whether a person committed the crime. If so, and if the defendant raises the insanity defense, the courts must determine whether that defense is valid.

The bar the defendant must clear to show insanity is preponderance of the evidence, which is a lower standard than proof beyond a reasonable doubt. “A defendant must prove that it is more likely so than not so,” McGann said.

He keyed in what motives were absent in the Avery case. Among them: Avery had no apparent anger problems and no resentment toward the children, and she wasn’t high on hallucinogenic drugs. To her, demon possession and exorcisms became a very real motive, McGann said.

He spoke about Avery’s belief that demons can enter people through their eyes, penetrate their souls and, without an exorcism, can pull people to hell.

McGann read from writings that police found inside Avery’s townhouse. The women had written love notes to imagined spouses, made “dark apocalyptic assertions,” wrote a grocery list for a demon assassin party and advanced general comments on society.

McGann recited one of the entries that covered “the president and first lady being shape shifters, the antichrist’s messenger as the pope, a plan for the world, tracking devices and the hidden occult, the whore of Babylon and the beast of Babylon.”

In court, McGann also spoke of how the children died. As young as Norell was, the judge said, “he instinctively mustered the strength to fight his mother. This was evidenced by defensive wounds on his tiny hands and fingers.”

“What delusional thinking overpowered Ms. Avery to cause her to choke Zyana unconscious, and then [stab] her pristine chest 13 times?”

McGann also wondered “what distorted thoughts” caused Avery to stab the older children after they were awakened by the stabbing of their siblings.

“I find that Ms. Avery’s ritualistic, albeit barbaric, attempt to rid her children of demons, is powerful evidence of her lack of rational thinking,” McGann said.