CHESTER — Maine Attorney General Janet T. Mills said three Maine state troopers reasonably believed they faced imminent deadly force when they shot and killed a man during a Chester standoff.

Sgt. Nicholas Grass, Sgt. Donald Shead and Detective Greg Mitchell fatally shot 35-year-old Shad Gerken of Woodville on Sept. 27 after an hours-long standoff in a wooded area.

The incident began around 10 a.m. when a motorist and an 8-year-old girl reported seeing Gerken walking on Woodville Road in Chester carrying a large knife. Gerken threatened the girl, telling her to stop looking at him or he would kill her. A Penobscot County sheriff’s deputy and a Maine game warden located Gerken, who ran into nearby woods when he saw the officers. The officers gave chase and a fight ensued, during which the officers ordered Gerken to drop the knife and pepper-sprayed him. When he refused to drop the knife, the deputy tried to take the knife away from Gerken and sustained cuts to his hand, according to the attorney general’s report.

A standoff ensued after other law enforcement officers arrived at the scene. Gerken continued to threaten the officers, and at times appeared ready to stab himself. Officers deployed a fire hose and foam baton to try to disarm Gerken. Crisis negotiators at the scene were told of Gerken’s mental health history, which included diagnoses of bipolar disorder, post-traumatic stress disorder and attention-deficit hyperactivity disorder according to the report.

After several hours, Gerken lunged at Shead and Mitchell. Shead fired several gunshots at Gerken, who fell to the ground and then tried to get back up. Shead then fired at him again, as did Mitchell and Grass.

Gerken was pronounced dead at the scene. It was determined he had been hit by 20 to 26 gunshots.

The attorney general’s report concluded that the three officers acted in self-defense and that each reasonably believed that unlawful deadly force was imminently threatened against them and against other officers.

The report says it is beyond the authority of the attorney general to determine Gerken’s “motivations, his state of mind, or the medical or psychological underpinnings of his behavior and actions.”

A Portland Press Herald investigation in 2013 found that 42 percent of people shot by police since 2000 had mental health problems.