Matthew Edward Riehl reportedly made threats and showed signs of mental illness weeks before he allegedly shot dead a sheriff's deputy and wounded four other officers Sunday near Denver, Colorado, UPI reported.

Detectives in Wyoming alerted Colorado police to Riehl's behavior six weeks ago, after he sent emails containing veiled threats against his professors at the University of Wyoming in Laramie, where he obtained a law degree, UPI reported.

Chief Mike Samp of the University of Wyoming Police Department said the content within Riehl's emails was indicative of mental illness.

"These messages were highly indicative of someone with major mental health problems. It was definitely on the dark side of the spectrum," he said, per UPI. "Everybody knew Mr. Riehl could use some help."

However, local legislation could have prevented authorities from acting.

"Wyoming statutes are pretty clear: If someone is not making an immediate threat, they cannot be held for a mental evaluation. They are very tough cases," Samp said, according to The Denver Post.

Riehl, who has been identified as an Iraq War veteran, also rallied against Douglas County Sheriff Tony Spurlock in a YouTube video entitled "Fire Sheriff Spurlock" that was posted on Dec. 13, 2017, NBC News noted.

Although he did not threaten violence, Riehl made a call to "fire all these bums come early next year."

The shooting occurred after police responded to a domestic disturbance call and, upon arriving at the scene, were hit by a hail of gunfire.