(CNN) -- Anissa Weier, one of two Wisconsin teens charged in the 2014 "Slenderman" stabbing of a classmate, will be committed to state mental care for 25 years, a judge ordered Thursday.
According to Waukesha County Circuit Judge Michael Bohren's ruling, Weier, 16, will spend at least three years at a mental health facility before she can ask to be discharged. If doctors deem she can be released for outpatient care, she could then be under state supervision until she is 37.
If doctors don't approve her release she will stay at the Winnebago Mental Health Institute.
Attorney Maura McMahon hopes her client will be able to live among the community beginning in July 2020.
"If she is continuing on doing well," McMahon told reporters, "taking any medication that is required, meeting with her therapist ... I'm hoping going to college, getting a job, all the wonderful things that she wants to do, she'll remain out of custody but being supervised by her agent."
Three years ago Weier and Morgan Geyser, who were 12 at the time of the crime, lured a 12-year-old classmate into a park in Waukesha, Wisconsin, where they stabbed her 19 times to please Slenderman, a boogeyman for the internet age.
The victim survived, crawling to safety before she was discovered by a bicyclist.
Weier apologized at Thursday's hearing for her actions.
"I want everyone to know I deeply regret everything that happened that day," she said. "I know that nothing I say is going to make this right and nothing I say is going to fix what is broke. I am never going to let this happen again."
The mother of the victim wrote a letter to the judge before Weier was committed.
The woman wrote that her daughter for months after the stabbing slept with scissors under her pillow.
"While (my daughter) believes a mental health facility is the best place for Morgan and Anissa she still fears for her safety," the woman wrote. "She still sleeps with her windows closed, locked, and with the security latches engaged. She still refuses to open her curtains. ...
"I know she will not feel safe if either Morgan or Anissa are released back into the community unsupervised."
Weier had pleaded guilty in August to attempted second-degree homicide due to mental illness or defect in the stabbing as part of a plea agreement stipulating she would accept commitment to institutional care.
During a trial to determine Weier's mental state, 10 out of 12 jurors in September found Weier not criminally responsible because she was mentally ill at the time of the attack.
Bohren granted Weier credit for the 1,301 days she has been in custody.
CNN does not typically name minors charged with crimes, but it makes exceptions if they are charged -- as were Geyser and Weier -- as an adult.
In October, Geyser, 15, entered a guilty plea to a charge of attempted first-degree murder.
The plea agreement called for Geyser to enter the plea, and then for Bohren to find her not guilty by reason of mental disease or defect, meaning she would ultimately not be held criminally responsible for the attack.
"It's a confusing thing to describe because clearly she committed an offense but the law doesn't treat her as responsible for that crime because of her mental illness," Geyser's attorney, Anthony Cotton explained to CNN at the time.
As part of the deal, under Wisconsin law, Geyser avoids further jail time and will be committed to a mental institution. In the end, Cotton said, Geyser "would not be considered to have a criminal record."
"I know she's remorseful for what happened," Cotton added.
Doctors are evaluating Geyser and have yet to recommend how long she should be committed.