(Reuters) - A Wisconsin appeals court ruled on Wednesday that two teenage girls should be tried as adults on charges they attempted to kill a classmate by stabbing her repeatedly to please a fictional Internet character named Slenderman.

The girls, Anissa Weier and Morgan Geyser, have been in custody since they were charged with attempted first-degree homicide in the May 2014 attack in Waukesha, a suburb of Milwaukee.

All three girls were 12 years old at the time of the stabbing. Weier and Geyser are now 14.

In a pair of rulings, the 2nd District Court of Appeals determined that the Waukesha County Circuit Court "properly exercised its discretion given the facts presented and made a decision a reasonable judge could make."

The girls can appeal to the Wisconsin Supreme Court.

An attorney for Weier could not be immediately reached for comment on the ruling. Geyser's lawyer was not taking any calls from the media.

Kevin Osborne, the assistant Waukesha County District Attorney, said prosecutors were pleased with the decision and was waiting to see what defense attorneys do next. A status hearing is scheduled for Aug. 19.

The girls' lawyers had argued that the girls were mentally ill when they stabbed their classmate. A judge ruled Weier and Geyser both were competent to stand trial. Health experts testified that Geyser suffers from schizophrenia, but has refused to take medication. Weier was diagnosed with a delusional disorder that made her believe in Slenderman.

Prosecutors have said the girls lured the classmate into the woods and stabbed her 19 times to impress Slenderman, a fictional supernatural Internet character depicted in stories as stalking and tormenting humans, especially children. The stabbing occurred after a sleepover and was planned for months.

The victim, who has been only with the initials P.L., was found crawling out of the woods by a bicyclist. She spent six days in the hospital and returned to school last fall.

Weier and Geyser could each be sentenced to up to 65 years in prison if convicted as adults. They could be held until the age of 25 if convicted as juveniles.

Wisconsin law requires cases to begin in adult court if they involve juvenile suspects at least 10 years old who are charged with first-degree attempted intentional homicide.

(Reporting by Justin Madden in Chicago; editing by Grant McCool)