A former Central Michigan University student accused of killing his parents in a dorm last year was ordered to a psychiatric facility Friday, in lieu of a trial, after a judge ruled he was mentally ill when he committed the murders.

James Eric Davis Jr., 20, was arrested after prosecutors say he shot and killed his father James Eric Davis Sr., 48, and his mother Diva, 48, on March 18, 2018. A manhunt involving more than 100 police officers ensued for nearly a day before Davis was caught.

CMU STUDENT WHO ALLEGEDLY KILLED PARENTS USED GUN REGISTERED TO FATHER, POLICE SAY

Davis shot his parents using a gun that belonged to his father who was a part-time police officer in a Chicago suburb.

The night before the shootings, Davis had been admitted to the hospital after telling police someone was trying to kill him.

Davis was found fit to stand trial last fall but pleaded not guilty by reason of insanity.

On Friday, the judge and prosecutor agreed Davis did not understand his actions and agreed to send him to a psychiatric facility where he could remain for the rest of his life, Fox 17 reported.

Fox News’ Kathleen Joyce contributed to this report.