(Reuters) - One of two Wisconsin girls accused of stabbing a classmate to please a fictional character named Slenderman on Monday pleaded guilty to a reduced charge.

Anissa Weier, 15, appeared in a Waukesha court on Monday to plead guilty to attempted second-degree homicide as a party to a crime with use of a deadly weapon, as part of a plea agreement, court records show.

She will proceed to trial on Sept. 11 only on the question of whether her mental condition should make her legally responsible for her actions.

Under the plea agreement, she will then spend 10 years either in prison or in a state mental hospital, depending on the outcome of the September trial, according to the Milwaukee Journal Sentinel newspaper.

Neither Prosecutors nor Weier’s attorney could immediately be reached for comment on Monday.

Weier and her friend, Morgan Geyser, were charged with attempted first-degree homicide in the May 2014 stabbing of their classmate in Waukesha, a Milwaukee suburb. All three girls were 12 at the time. The stabbing victim survived the attack.

After a sleepover with their classmate and friend, Weier and Geyser lured her into the woods and stabbed her 19 times with a kitchen knife, according to a criminal complaint.

The girls told investigators they stabbed her to impress Slenderman, a tall, creepy fictional bogeyman they insisted was real, the complaint said.

Geyser was also due in court on Monday for a status hearing, but her attorney, Donna Kuchler said in a phone interview that no plea agreement was in the works. Geyser is scheduled for trial in October, Kuchler said.

Weier’s plea on Monday means that even if a jury finds her not guilty by reason of mental disease or defect she will not seek conditional release from a state mental hospital until July 2020, the Journal Sentinel reported.

If she is found guilty, prosecutors will recommend a sentence of 10 years in prison and 10 years of extended supervision, according to the paper.