JOPLIN, Mo. (AP) — A judge has ruled that a 31-year-old Joplin man who shot five people in 2016 is not guilty by reason of insanity.

Attorneys for Tom Mourning Jr. have long argued that he is schizophrenic and did not know what he was doing when he shot at two vehicles on Aug. 13, 2016. Five people in the vehicles were injured but all survived.

He had pleaded not guilty by reason of insanity, and after a hearing last week, Judge Gayle Crane agreed with the plea. The Jasper County prosecutor’s office did not oppose the plea.

Assistant Jasper County Attorney Kimberly Fisher said all doctors who evaluated Mourning believed he was mentally ill at the time of the shootings.