The plea agreement means Robert Bales will avoid the death penalty. However, as part of the deal, it requires that Bales recount the horrific attack for the first time.
His attorney, John Henry Browne, told The Associated Press that his client was "crazed" and "broken" when he allegedly slipped away from his outpost in southern Afghanistan and attacked two villages on March 11, 2012. Most of the victims were women and children.
Browne said Bales was suffering from post-traumatic stress disorder and a traumatic brain injury. Browne previously indicated Bales remembered little from the night of the massacre, and he said that was true in the early days after the attack.
But as further details and records emerged, Bales began to remember what he did, the lawyer said, and he will admit to "very specific facts" about the shootings.
The Army had been trying to have Bales executed, and Afghan villagers have demanded it. Some of the victims' families have expressed anger over the possibility that Bales might escape the death penalty.
The Associated Press contributed to this report.