A Casper man was found to be not guilty by reason of insanity for threatening to kill a federal judge in 2017, according to a judge's verdict.

David Michael Chavis and federal prosecutors agreed that he sent a threatening letter to U.S. District Court Judge Scott Skavdahl on Dec. 27, 2017, according to the verdict handed down by Judge Alan Johnson after a hearing last week.

Johnson wrote, "... at the time this conduct occurred, the defendant was unable to appreciate the nature and quality of the wrongfulness of his conduct because of the severe mental disease or defect of schizophrenia."

An expert psychologist testified at the hearing in federal court, and the evidence from the psychologist and other sources determined Chavis had been restored to competence, according to the verdict of "not guilty only by reason of insanity."

Johnson ordered Chavis to be placed in a facility where he can be evaluated to determine if his release would cause harm to another person or property because of the mental illness. Chavis will appear in court on Aug. 9 to determine whether he can be released.

Chavis had been in custody after his arrest on Aug. 5, 2016, when he entered the office of the Attorney General's Medical Review Panel, 800 Werner Court, and held a hostage at knife point. The incident ended peacefully.

He was charged in Natrona County District Court with kidnapping, aggravated assault and possession of a deadly weapon with intent to threaten the life of another.

Chavis, who had a long criminal history, was ordered to a mental health evaluation after his arrest.

Natrona County District Court Judge Daniel Forgey ordered to undergo another one in May 2017.

In August 2017, he was found incompetent to stand trial and was ordered to spend two months at the Wyoming State Hospital in Evanston to determine whether he was fit to stand trial.

In February 2018, Forgey ordered the case dismissed after a competency hearing during which a forensic psychologist said Chavis' schizophrenia with paranoid delusional thinking has not changed and probably will not change.

In September 2018, Johnson found Chavis to be mentally incompetent to stand trial, and last week's ruling ended the case.