A young girl accused of trying to kill her friend, in a plot she told police was inspired by the fictitious "Slenderman" character, has been deemed mentally unfit to stand trial in America.

Morgan Geyser and her classmate Anissa Weier are charged with the attempted murder of another 12-year-old after a sleepover in May.

Handcuffed, and dressed in blue overalls, Morgan Geyser sat next to her lawyers during the hearing at Waukesha County Court in Wisconsin.

As she fidgeted on the chair, she occasionally tucked her long blonde hair behind her ears.

Most of the time she stared blankly ahead, as experts discussed her mental state.

The court heard how the 12-year-old believed in fantasy and fictional characters, and thought she had special powers, which allowed her to see and hear things others couldn't.

"She believes in mythological creatures, she believes they're real," her lawyer Anthony Cotton said.

"She believes in Slenderman, she believes in Teenage Mutant Ninja Turtles.

"She believes she has the power of Vulcan mind-control which would let her somehow get through any sentence that would be imposed."

Experts in the court spoke of how, during interviews, Geyser told doctors she had a strong bond with the Slenderman character, who she idolised and believed to be real.

"It's hard when a child is that young to know whether that's simply imaginative or whether this is something much more concerning, like an undiagnosed mental health condition," said Anthony Cotton.

The judge ruled that Morgan Geyser is currently mentally unfit to stand trial, and should get treatment.

Her classmate Anissa Weier, sat on the other side of the courtroom, her short brown hair braided on one side. Hearings in her case are set to continue.

The two girls didn't exchange glances throughout the hearing. Both sets of parents watched from the viewing gallery. Geyser's parents wiping away tears with a handful of tissues as they listened in.

Both girls are currently being tried as adults, their lawyers want the case moved to a juvenile court. They are accused of trying to kill their friend in May.

A short drive away on the edge of an affluent neighbourhood, is the overgrown gravel path, where the victim was found by a passing cyclist, after the attack. Police reports say the three girls had come to the woods after a sleepover.

Geyser and Weier told officers they stabbed her during a game of hide and seek, in the adjoining woods.

The victim, who has chosen to remain anonymous, was stabbed 19 times, 11 in the arms and legs, 8 in the torso. Some of the stab wounds missed major arteries by millimetres. Her family say it's a miracle she survived.

"Her will to live was so strong she crawled out of those woods, and today she's at home, she gets to wake up and play with her little brother and play with her dogs and her cats and do things like a typical 12-year-old girl," says Steve Lyons, the family spokesman.

The crime has left people here in the small town of Waukesha shocked, not just because of the age of the girls involved, but the apparent motive.

Geyser and Weier told police a fictional character called Slenderman inspired them to carry out the attack. They believed if they killed their friend, they'd become his agents and live with him in his mansion.

Featured in video games, stories about Slenderman appear on horror forums including the creepypasta website, which is popular with teenagers in this town. I met Rachel and Alyssa playing volleyball.

"He's like an eight or nine-foot-tall man, no face, white skin. He wears a suit and tie and he has long tentacles. He attacks people and children, usually it's in the setting of a woods," says Rachel.

"Kids like horror stories, and it's just like a fun game."

Alyssa doesn't follow the stories herself, but knows plenty who do: "A lot of kids get so involved in the game that he becomes almost a role model for them. Things happen, kids are kids, but that's what happens when young kids get shown a dark role model."

The creator of creepypasta.com says Slenderman can't be blamed, and that mental health issues need to be better addressed.

"We live in a culture with a very unhealthy relationship with mental illness. People with mental health issues are frequently dismissed, shamed and bullied and often ignored and denied necessary treatment."

Morgan Geyser will now receive treatment, which means it could be some time before she goes to trial. Anissa Weier's next court hearing is due next month.

As Waukesha wrestles with a crime which has thrust it into the spotlight, it's also focusing on the positive.

The victim has received thousands of messages of support.

An online fundraising campaign has raised more than $60,000 (£35,000) and thousands have posted notes of support with hearts in the victims favourite colour, purple.

Despite being injured so badly, she's expected to go back to school when term starts in September.

Her family says that while these events brought out the worst in a few people, they also demonstrated the best in so many others.

Follow @BBCNewsbeat on Twitter and Radio1Newsbeat on YouTube