MOUNT PLEASANT, Mich. (AP) — An Illinois man charged with killing his parents in his Michigan university dorm room was committed to a psychiatric facility Friday after a judge found he was mentally ill at the time of the shootings.

The decision means there won’t be a trial for 20-year-old James Davis Jr., who had pleaded not guilty by reason of insanity and could be held indefinitely.

James Eric Davis Jr. has been identified as the gunman who shot and killed two people at Central Michigan University on March 2, 2018. (Credit: Twitter/@MtPleasantMI)

“It’s important that the public understand that this does not mean that Mr. Davis is free to return to society,” said Isabella County prosecutor David Barberi. “Today’s plea brings an end to a very tragic event that temporarily marred the safety and comfort that we all know and value in our community and at Central Michigan University.”

Davis was accused of shooting his parents, James Davis Sr. and Diva Davis, when they tried to bring him home to Plainfield, Illinois last March during spring break. He showed erratic behavior the previous night, telling police that someone was trying to kill him.

RELATED Bellwood Police Officer, Wife Killed In Central Michigan University Shooting

Davis was captured 16 hours after the shootings. A train conductor called 911 when he saw him wearing only underwear. He spent five days in a hospital getting treatment for hypothermia.

Davis’ mental health will be periodically evaluated by the county Probate Court.

“It’s a fair outcome,” defense attorney Joshua Blanchard said. “It’s not a common resolution, but it’s the right one in this case.”

Davis Sr. was a part-time police officer in Bellwood, Illinois. Investigators said Davis Jr. took a pistol from his father’s car and shot his parents.

Copyright 2019 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.