MADISON, Wis. (AP) — A Wisconsin appeals court says a man convicted of killing five people, including his father, should not have been transferred from a mental hospital to a state prison.

The 3rd District Court of Appeals ruled Tuesday in the case of Bruce Brenizer. He was 15 years old in 1991 when he shot and killed his father, the father’s live-in girlfriend and her three children in rural Polk County.

Brenizer was committed to the Mendota Mental Health Institute in Madison for life for the deaths of the three children.

In 2013, Brenizer was transferred from the mental health institute to the state prison in Waupun.

The appeals court agreed with Brenizer on Tuesday and said he should not have been transferred out of the mental institution because his life sentence there had not been terminated.