A suburban Chicago police officer who fired beanbags at a knife-wielding 95-year-old man who later died testified at his trial Thursday that his action was prompted by the fear he had for his life.

Park Forest Police Officer Craig Taylor made the assertion during testimony in his bench trial on felony reckless conduct charges in the death of John Wrana Jr.

Taylor was one of several officers dispatched to the assisted-living facility where Wrana lived in July 2013 after a staff member reported the man had become combative. Wrana, who had barricaded himself in his room, was shot five times with a beanbag gun before he dropped the knife and cane he was wielding. He died hours later.

Taylor told Associate Cook County Judge Luciano Panici that he was following the instructions of his superior when he fired five beanbag rounds from a shotgun.

Taylor said he saw Wrana holding a knife over his head and shouting, "Don't come in my room or I will kill you!" Taylor testified he was afraid and felt like he "had to do something to stop him."

Defense attorneys have said Wrana might have survived his injuries if he had consented to surgery. Tom Mangerson, one of Wrana's grandchildren, said Thursday that his relative didn't want the surgery because he feared he wouldn't make a full recovery and would wind up on life support.