Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

WAUKESHA, Wis. — One of two Wisconsin girls charged with stabbing a classmate to impress the fictitious horror character Slender Man will plead guilty in a deal that calls for her to avoid prison time, attorneys announced Friday.

Fifteen-year-old Morgan Geyser will remain in a state mental hospital under an agreement announced in a court hearing two weeks before her trial was set to start. The deal calls for Geyser to be evaluated by doctors who will report to a judge for a determination of how long she should remain in treatment.

Morgan E. Geyser is escorted into a Waukesha County Court, F on Nov. 11, 2016, in Waukesha, Wisconsin. Michael Sears / AP file

Geyser and Anissa Weier were charged with attempted first-degree intentional homicide in the 2014 attack on classmate Payton Leutner. Weier pleaded guilty to a reduced charge last month, and a jury later concluded she was mentally ill at the time of the crime. She faces at least three years in a mental hospital.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

All three girls were 12 at the time.

"It's been a tragic experience for everyone" Geyser's attorney, Donna Kuchler, said after the brief court hearing. "Our hearts go out to the victim and her family. And we're very grateful that the district attorney's office gave this case the considering it deserves," she said.

A plea hearing to make the deal official is scheduled for Thursday.

Prosecutors alleged the teenage girls stabbed Leutner 19 times in a wooded area following a sleepover, then left her. The girls planned to walk hundreds of miles north to meet Slender Man in a forest. Both suspects were 12 at the time of the attack.

Leutner was able to crawl out of the woods in the park to a path where she was found by a bicyclist.