A shared delusion played a major role in leading two girls to stab another 12-year-old girl 19 times in a Wisconsin park as a tribute to the horror character Slender Man, a psychologist testified Wednesday.

Melissa Westendorf testified at Anissa Weier's mental capacity trial in Wisconsin that she believes Weier suffered from a shared delusional disorder when she and Morgan Geyser tried to kill Payton Leutner in 2014.

Westendorf admitted under cross-examination that the condition is rare among two children who are friends. Most cases involve spouses, a parent and child, or siblings, she said.

She was asked by Weier's lawyer why she did not recognize that the belief in Slender Man and his powers to kill them or their families was a delusion.

Anissa Weier, now 15, appears in a Wisconsin courtroom earlier this year.

(Michael Sears/AP)

"First of all, she was 12," Westendorf said, adding that the teen was influenced by a website focused on imaginary killers. "If adults have trouble distinguishing fake news, 12-year-olds will, because their brains can't yet discern or analyze as well."

Weier made a deal with prosecutors in August to plead guilty to being a party to attempted second-degree intentional homicide, but also pleaded not guilty due to mental illness or defect. Westendorf was appointed by a judge to evaluate Weier, now 15, after her plea.

Geyser, who did the stabbing, will go on trial next month. She has also pleaded not guilty by reason of mental disease.

The teens blame a fictional horror character for the attack.

(HBO Documentary Films)

A detective who interviewed Leutner testified in the Waukesha County courtroom that Geyser had been scaring her beforehand with stories about characters from a horror website.

Leutner became so concerned about the stories that she asked her mother if they were real, according to Waukesha Police Detective Shelly Fisher.

Weier told authorities that she and Geyser believed they had to kill Leutner or else Slender Man would kill them and their families. At one point before the attack, prosecutors claim Weier unleashed Geyser by saying "go berserk," according to the Journal Sentinel.