Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A judge has sentenced a Wisconsin girl to the maximum 40 years in a mental hospital for stabbing a classmate in an attack aimed at pleasing a fictional horror character known as Slender Man.

Judge Michael Bohren says 15-year-old Morgan Geyser remains a risk to hurt herself or others.

Morgan Geyser, 15, appears for sentencing before Waukesha County Circuit Judge Michael Bohren, Thursday, Feb. 1, 2018 in Waukesha, Wisconsin. Rick Wood / Milwaukee Journal-Sentinel via AP, Pool

Geyser and another girl lured a classmate to a suburban Milwaukee park in 2014 and carried out the attack, with Geyser doing the stabbing. All three girls were 12 at the time.

Bohren said in passing sentence Thursday that although the attack happened when the girls were young, "what we can't forget is this was an attempted murder."

Geyser spoke briefly before she was sentenced, breaking down in tears as she apologized to the girl she stabbed. That girl survived.