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

One of two US girls convicted of a 2014 stabbing to honour the horror character Slender Man has been sentenced to 25 years in a mental hospital.

Anissa Weier, 16, pleaded guilty to being a party to attempted second-degree homicide, but claimed she was mentally ill at the time.

She and Morgan Geyser lured a classmate into a Wisconsin wooded park where Geyser stabbed her 19 times as Weier stood by. The victim survived.

All three girls were 12 at the time.

The victim 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.

Waukesha County Circuit Judge Michael Bohren on Thursday sentenced Weier to the maximum punishment of 25 years in a psychiatric institution.

The sentencing is retroactive to the date of the crime in May 2014, which means she will be committed until the age of 37.

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

Before her sentencing, Weier told the judge: "I do hold myself accountable for this and that I will do whatever I have to do to make sure I don't get any sort of delusion or whatever again.

"I want everybody involved to know I deeply regret everything that happened that day. I know that nothing I say is going to make this right and nothing I say is going to fix what I broke."

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

Earlier this year Geyser pleaded guilty to attempted first-degree intentional homicide in a deal with prosecutors to avoid a prison term.

She is scheduled to be sentenced in February. Prosecutors have asked that she be sent to a mental hospital for at least 40 years.