SEATTLE -- A U.S. soldier accused of killing 16 Afghan civilians in two rampages from his Army post last year has reached a plea deal with prosecutors to avoid the death penalty, one of his lawyers said on Wednesday.

Robert Bales, a decorated veteran of four combat tours in Iraq and Afghanistan, is accused of gunning down villagers, mostly women and children, in attacks on their family compounds in Kandahar province in March 2012.

Lawyer Emma Scanlan said in an email he would plead guilty to premeditated murder charges and would then go before a military jury for sentencing to determine whether a life prison term for his crimes would include the possibility of parole.

"There will be a jury for the sentencing phase beginning in August," Scanlan said.

Army prosecutors have said Bales acted alone and with chilling premeditation when, armed with a pistol, a rifle and a grenade launcher, he left his base twice in the night, returning in the middle of his rampage to tell a fellow soldier: "I just shot up some people."

The shootings marked the worst case of civilian slaughter blamed on a rogue U.S. soldier since the Vietnam War and further eroded strained U.S.-Afghan relations after more than a decade of conflict in that country.

Defense attorneys have said Bales was suffering from post-traumatic stress disorder (PTSD) and a brain injury even before his deployment to Afghanistan.

Bales is to enter a guilty plea on June 5 at Joint Base Lewis-McChord, a military installation in Washington state. The judge and a commanding general must still approve the deal.