WAUKESHA, Wis. -- One of two 12-year-old girls charged as an adult with stabbing a classmate to please a fictional online horror character is mentally incompetent and can't stand trial, a judge said Friday.

The judge also ordered that she be committed for treatment. She will be evaluated and treated either in a hospital or in a juvenile detention centre, where she is currently being held. Doctors have a year to restore her to competency in order to proceed with a trial. If it cannot be restored, she could be held in a treatment centre.

Judge Michael Bohren acted after receiving reports from two doctors and hearing from attorneys. He set a hearing for Nov. 12 to get an update on her condition.

The girl's attorney previously said he believed she was mentally ill and a primary goal would be to have her case moved from adult to juvenile court, where more mental health and other services might be available.

Wisconsin law requires anyone age 10 or older to be charged as adults in severe crimes. The Associated Press is not naming the girls because both of their attorneys had said they will try to get the cases moved.

According to court documents, the girls plotted for months to kill their friend -- who survived the attack -- to curry favour with Slender Man, a character in horror stories they read online. They told investigators they believed Slender Man had a mansion in a Wisconsin forest and they planned to go live with him after the slaying.

Dr. Brooke Lundbohm of the Wisconsin Forensic Unit testified Friday that she interviewed the girl in June. The girl claims to see and hear things that others cannot -- including unicorns, Slender Man and Voldemort, an antagonist in the Harry Potter series, Lundbohm said.

A psychiatrist hired by the defence, Kenneth Robbins, testified that the girl was more concerned about her relationship with Slender Man than she was about going to prison. She said she communicated telepathically with Slender Man and feared he would harm her or her family if she said too much about him, Robbins said.

The girl who was found mentally incompetent hosted the other two at a May 30 slumber party to celebrate her birthday. The next morning, the two girls attacked the victim in a wooded park. The other girl told investigators that she told the victim to lie down and be quiet after the stabbing so that she would lose blood more slowly. The girl said she hoped to convince the victim to be quiet so the victim would not draw attention to them and would die.

Once the attackers left, the 12-year-old victim crawled from the woods to a road where a passing bicyclist found her. Doctors later told police the girl had narrowly escaped death because the knife just missed a major artery near her heart.

The child has since been released from the hospital and is recovering at home. Police have not identified her, and her parents asked friends to keep her name secret.