(CN) – A Wisconsin teenager convicted of the attempted murder of her classmate at the behest of fictional boogeyman Slenderman has appealed her sentence of 40 years in a mental institution, arguing her mental condition led to unfair proceedings.

In the 46-page brief filed Thursday in the Wisconsin Court of Appeals, Morgan Geyser’s attorney Matthew Pinix, a partner at Milwaukee-based law firm Pinix & Soukup, asserts that the Waukesha County Circuit Court never should have tried her in adult court given Geyser’s mental illness.

Morgan Geyser, who was 12 when she and Anissa Weier plotted to kill their sixth-grade classmate in 2014, appears for sentencing before Waukesha County Circuit Judge Michael Bohren on Feb. 1, 2018. (Rick Wood/Milwaukee Journal Sentinel via AP)

“The juvenile court, not the adult court, had exclusive jurisdiction over her crime, and the circuit court should have discharged her adult-court case following her preliminary hearing,” the brief states.

Geyser, now 16, also wants the state appeals court “to conclude that her statements [to police] were obtained in violation of her constitutional rights.”

In 2014, she “tried to kill her best friend because she believed that, if she did not, Slender Man would kill her or her family,” according to the brief.

Anissa Weier joined Geyser in the stabbing of their friend Payton Leutner on the morning of May 31, 2014, after they had a sleepover together. All three girls were 12 years old at the time.

Leutner was found crawling out of woods with 19 stab wounds near Geyser’s home in Waukesha, Wisconsin, the morning after the three then-12-year-old girls had a sleepover. She survived after several surgeries.

Geyser and Weier were charged with attempted first-degree intentional homicide. The case made headlines around the world and the 2016 HBO documentary “Beware the Slenderman” brought renewed attention to the stabbing.

Both girls were convicted. Geyser, painted as the ringleader, was sentenced last year to 40 years in a mental institution. Weier was given 25 years, also in a mental institution.

Slenderman is an internet character that originated in online forums in 2009. The tall, thin, black-suited character was a winning upload in a contest that called for the creation of paranormal images, complete with fake quotes referencing the kidnapping and murder of children.

Weier introduced Geyser to the character four years later.

According to Thursday’s brief, the mythology of Slenderman combined with Geyser’s undiagnosed mental illness led her to believe that he had visited her when she was a toddler.

“Of course, Slender Man had never actually visited Geyser; the interactions were a hallucination and a byproduct of her mental illness,” the filing states.

The brief continues, “Geyser believed that if she did not do what Slender Man wanted- namely to kill to become his proxy- he would, in turn, kill her or her family.”

After the stabbing, Geyser and Weier were found by sheriff’s deputies in some tall grass near the freeway hours later. They said they were going to walk to Slenderman’s mansion in Nicolet National Forest, about 300 miles away in northern Wisconsin.

The appeal brief states that after eventually saying she understood her rights, Geyser was taken to the police department but was not allowed to talk with her parents even once during the seven and a half hours between her arrest and confession.

“As would later come out during competency proceedings, Geyser did not fully understand the legal system or how it applied to her even three weeks after she signed the Miranda form,” the brief states.

In all the interviews that took place in the following months intended to educate her about the legal system, a psychiatrist working with Geyser found that her Slenderman beliefs “so impugned her ability to work in her own self-interest that they prevented her from being able ‘to work effectively with an attorney to defend her own interests.’”

Her primary motivation was always to appease Slenderman rather than “to protect herself from any adverse legal consequences- of which she knew little,” her attorney argues.

Geyser ultimately agreed to plead guilty to attempted first-degree intentional homicide, with the stipulation that she would be found not guilty by reason of mental disease.

“Admittedly,” the brief states, “the tactics police used with Geyser may have passed muster with a fully-functional adult, but Geyser was far from that. She did not understand her legal rights, including what an attorney could do for her. The interviewing detective repeatedly minimized the seriousness of her crime and the effect of confessing to it. On balance, the tactics police used on Geyser were coercive and most certainly overwhelmed whatever minimal ability she had to resist.”

Geyser’s attorney, Pinix, said via email that the “criminal justice system did not work as it should have in Ms. Geyser’s case.”

“Our system is supposed to safeguard the rights of defendants in the pursuit of justice, but those safeguards failed in Ms. Geyser’s case,” he said.

The state’s response brief is due by Feb. 4.