(CNN) A second Wisconsin teenager accused of stabbing a classmate to please the fictional Internet bogeyman Slenderman has accepted a plea deal, her attorney said Friday.

Morgan Geyser, 15, will appear in court Thursday, October 5, to plead guilty to a charge of attempted first-degree murder, attorney Donna Kuchler told CNN.

However, the plea deal stipulates Geyser was not criminally responsible due to her mental health, Kuchler said. She will be committed to a mental hospital operated by the state Department of Health Services, Kuchler said.

Prosecutors could not be reached for comment Friday.

JUST WATCHED Jury: Teen in 'Slenderman' case mentally ill Replay More Videos ... MUST WATCH Jury: Teen in 'Slenderman' case mentally ill 01:00

Geyser and Annisa Weier were both 12 in May 2014 when they allegedly stabbed a 12-year-old schoolmate in a Waukesha park 19 times and left her to crawl to her own rescue. The victim has since recovered from her injuries.

CNN does not generally name minors who are charged with crimes, but it does make exceptions if the minors are charged as adults. Both Geyser and Weier were charged as adults.

Weier, 15, pleaded guilty in August to attempted second-degree homicide due to mental illness or defect in the stabbing as part of a plea agreement. Then, in September, a jury said Weier was mentally ill when the attack occurred.

Weier will spend at least three years at a mental hospital before she can petition for her release, her lawyer, Maura McMahon, said at Weier's hearing. A judge could also order a commitment of up to 25 years, she said.

One of the girls encountered the name of Slenderman on a website known as Creepypasta Wiki, authorities said. One of the suspects allegedly told police that Slenderman is the site's supposed leader, and to climb into his realm, a user must kill someone.

During the trial, a psychologist testified that Weier developed a condition called shared delusional disorder, in which she came to share Geyser's delusion that Slenderman was real, CNN affiliate WISN reported.