MISSOULA (AP) — A man who was swinging a machete and making lethal threats was shot and killed as Missoula County law enforcement officers tried to deescalate the situation, the sheriff’s office said.

Officers responded to a disturbance northwest of Missoula at about 5:30 p.m. Sunday.

The man did not comply with verbal commands and deputies initially used a “less lethal option” to try to get him to comply, the sheriff’s office said.

That failed and the man continued to pose a lethal threat, officials said.

At least one officer fired shots at the man, Sheriff TJ McDermott said. The suspect was flown to a hospital in Missoula where he died of his injuries. His name has not been released.

“Our deputies are faced with difficult and sometimes dangerous situations such as the incident this evening,” McDermott said in a statement Sunday. “We recognize the profound impacts these tragic events have on our deputies and all those involved. Our heartfelt condolences go out to the family and friends of the suspect involved in this incident.”

The state Department of Justice’s Division of Criminal Investigation will investigate the shooting.