Image copyright Police Photo Image caption Morgan Geyser (L) and Anissa Weier (R) were 12 at the time of the crime

A jury in the US state of Wisconsin has determined that a girl who admitted to participating in a stabbing in 2014 to please the horror character Slender Man was mentally ill during the attack.

Anissa Weier, now 15, had pleaded guilty in August to being a party to attempted second-degree homicide.

But she said she was not responsible for her actions on grounds of insanity. She will be sent to a mental hospital.

The victim, a classmate, was stabbed 19 times in May 2014 but survived.

She was found crawling from woods by a cyclist near the city of Waukesha, a western suburb of Milwaukee. She had stab wounds to her arms, legs and torso.

Anissa Weier told investigators that she and co-defendant Morgan Geyser believed they had to kill their victim in "dedication" to Slender Man, a fictional horror website character.

But prosecutors said she knew what she was doing was wrong. All three girls were 12 at the time.

Who is Slender Man?

Image copyright mdl70/Flickr

He is a skinny, shadowy figure, who has appeared in photos, drawings and articles across the internet.

Some claim he has tentacles emerging from his back and most say he wears dark clothes and has a pale face.

The schoolgirls involved in the attack in Waukesha say there were inspired after reading about him in a creepypasta, a short online story designed to shock or scare the reader.

Slender Man first appeared on the internet in 2009.

Eric Knudsen from Florida created the character in response to a call for submissions from the online forum SomethingAwful and posted the picture of the figure behind a crowd of people.

Slender Man: Born in cyber land

The origins of Slender Man

A lawyer for Anissa Weier said that her mind was "broken" when the attack happened, the Associated Press reports.

The jury's decision means she will spend at least three years in a mental hospital, local broadcaster WISN says.

Morgan Geyser pleaded not guilty to being a party to attempted second-degree homicide. Her trial is set to start in October.