WAUKESHA, Wis. (AP) — The two girls accused of stabbing a sixth-grade classmate to appease an online horror character called Slender Man had a shared delusion that the fictional creature was real and could kill their families, a forensic psychologist testified.

Gregory Van Rybroek, who has worked with youth at the Mendota Mental Health Institute, was the second court-appointed psychologist to testify in Anissa Weier’s trial in Waukesha County Circuit Court. Jurors will decide whether Weier was suffering from a mental illness or defect at the time of the attack at a Waukesha park in 2014, when all three girls were 12 years old.

Closing arguments are scheduled for Friday.

Doctors said Payton Leutner nearly died after she was stabbed 19 times. She managed to crawl out of the park where a passing bicyclist found her.

Weier, now 15, and co-defendant Morgan Geyser told police they were trying to become a Slender Man proxy, or servant, and had to kill Leutner.

Van Rybroek’s testimony Thursday matched that of another psychologist who testified Weier and Geyser had a shared delusion about Slender Man. That delusion was so strong, Van Rybroek said, that Weier “couldn’t stop herself at the moment it mattered most,” and helped stab Leutner even though she knew it was wrong.

The Milwaukee Journal Sentinel said he testified about the delayed development of judgment and impulse control in adolescent brains, and the strong influence of peers within that age group. Certain stimuli can have unintended reactions among youth, Van Rybroek explained.

“They have really good accelerators but not very good brakes,” he said.

Michael Caldwell, a psychologist hired by Weier’s attorneys to evaluate her in 2014, also testified Thursday. He said he believes Weier suffered from persistent depressive disorder and schizotypy, a condition on the schizophrenia spectrum.

Prosecutors contend Weier knew what she was doing was wrong, but that she went along with the plot to preserve her friendship with Geyser.

Both Weier and Geyser were originally charged with being a party to attempted first-degree intentional homicide. Weier struck a deal with prosecutors in August in which she pleaded guilty to being a party to attempted second-degree intentional homicide, essentially acknowledging she committed all the elements of the offense. But she also pleaded not guilty due to mental illness or defect, setting up the trial on her mental status.

Geyser’s trial is due to begin Oct. 9. She has also pleaded not guilty by reason of mental disease.