Weeks before a man killed a Colorado sheriff's deputy and wounded four other officers, prosecutors considered but declined to file criminal charges against him over angry emails he sent.

Matthew Riehl ambushed police who responded to a 911 call he made from his apartment at a Denver suburb on Dec. 31.

Douglas County Sheriff's Deputy Zackari Parrish was killed before the 37-year-old Riehl was killed by police.

Riehl began sending angry emails after he was issued a traffic citation on Nov. 10. Riehl sent more than a dozen emails to the officer who ticketed him and to the municipal court.

This undated photo provided by the Douglas County Sheriff's Office shows Sheriff's Deputy Zackari Parrish, who was fatally wounded when a man fired dozens of rounds at the deputies in Denver. (Douglas County Sheriff's Office via AP)

KMGH-TV, a station in Denver, reports that public records it obtained showed police and prosecutors considering charges against Riehl.

But a few weeks later, prosecutors determined Riehl's rants against public officials weren't criminal.

"We do not believe there is a likelihood of success at trial," a prosecutor wrote in an email dated Dec. 14.

The same email noted that it was important to tell the suspect to stop the communications before harassment charges could be brought. "We have found that juries almost require that," wrote the prosecutor.