CASPER, Wyo. (AP) — A Wyoming prosecutor says a man shot and killed by police had induced a confrontation with officers with the intention of ending his life.

Douglas Oneyear was shot shortly before midnight on Feb. 25 in Casper after he reportedly swung a sword at a passing car and assaulted a convenience store clerk.

Prosecutors cleared both officers who were involved with the shooting. Oneyear's family has said he was carrying a toy sword and didn't pose a threat that required deadly force.

In a letter provided to the Casper Star-Tribune, Natrona County District Attorney Michael Blonigen wrote that officers faced a "suicide by cop situation" and had no choice but to shoot Oneyear, who had mental illness and substance abuse issues.