MORTON, Ill. (AP) — A central Illinois man has pleaded guilty to charges related to an incident in which he tried to kill another man in anger over child pornography charges he faced.

The Pekin Daily Times reports 20-year-old Dustin Brown entered two guilty but mentally ill plea agreements that produced a sentence range of 16 to 94 years in prison.

Brown was charged in February 2015 with 22 counts of possessing child pornography. Authorities say Brown entered the Morton Public Library in October 2015 and brandished two knives, saying he was going to kill more than a dozen children.

Seventy-five-year-old James Vernon, an Army veteran, was injured as he fought off Brown.

Brown told police the children had become targets of revenge for his pornography charges.

A Tazewell County judge will consider the sentence for Brown in a hearing Dec. 21.