Seattle AP

A U.S. Army staff sergeant charged with killing 16 villagers in one of the worst atrocities of the Afghanistan war will plead guilty to avoid the death penalty in a deal that requires him to recount the horrific attack for the first time, his attorney said.

Robert Bales was "crazed" and "broken" when he slipped away from his southern Afghanistan outpost in March 2012 and attacked mud-walled compounds in two sleeping villages nearby, lawyer John Henry Browne said Wednesday.

The army had been trying to have Bales executed, and Afghan villagers have demanded it. In interviews last month, relatives of the victims became outraged at the notion Bales might escape the death penalty.

"For this one thing, we would kill 100 American soldiers," vowed Mohammed Wazir, who had 11 family members killed that night, including his mother and 2-year-old daughter. Most of the victims were women and children, and some of the bodies were piled and burned.

Any plea deal must be approved by the judge as well as the commanding general at the U.S. base where Bales is being held. "The judge will be asking questions of Sgt. Bales about what he did, what he remembers and his state of mind," said Browne, who added that the commanding general has already approved the deal. A sentencing-phase trial is set for September.

Bales had been drinking contraband alcohol and snorting Valium that was provided to him by another soldier and had been taking steroids before the attack.

Browne said his client, who was on his fourth combat deployment, was suffering from post-traumatic stress disorder and a traumatic brain injury. He continued to blame the army for sending him back to war in the first place. "He's broken, and we broke him," Browne said.