JOINT BASE LEWIS-McCHORD, Wash. - Army Staff Sgt. Robert Bales pleaded guilty Wednesday to the 2012 slaying of 16 Afghanistan civilians.

Bales entered the plea in a military courtroom to multiple counts of premeditated murder and other charges. By agreeing to plead guilty, he will avoid the death penalty.

Col. Jeffery Nance, the judge presiding over the case, explained Bales' rights and asked if he understands them. Bales stood and answered: "Yes, sir, I do."

Bales, dressed in full uniform, was alert and spoke in a confident voice as he answered the judge's questions, surrounded by a group of six friends and family

The Ohio native and father of two from Lake Tapps, Wash., was charged with 16 counts of premeditated murder in the shooting or stabbings of mostly women and children. He was accused of slipping away from his remote southern Afghanistan outpost at Camp Belambay early on March 11, 2012, and attacking mud-walled compounds in two nearby villages..

Bales had been drinking contraband alcohol and snorting Valium and taking steroids before the attack. He was serving his fourth tour in a combat zone. The allegations against him raised questions about the toll multiple deployments were taking on U.S. servicemembers.

One of Bales' attorneys, Emma Scanlan, said in an e-mail to USA TODAY that he "is ready to accept responsibility for what he has done."

Bales says he does not remember much about the night of the killings, but John Henry Browne, another of his lawyers, said Bales has begun to remember some events and will admit to "very specific facts'' about the shooting deaths.

The military justice system hasn't executed anyone since 1961.

Bales, 39, is with the Army's 2nd Battalion, 3rd Infantry Regiment, 3rd Stryker Brigade Combat Team. A sentencing phase of the trial trial in September will determine whether Bales receives life in prison with or without the possibility of parole.

Browne described Bales as contrite about the killings now and "crazed" and "broken" the night of the attack. After a psychiatric examination, defense attorneys would not claim insanity, Browne said.

"His mental state does not rise to the level of a legal insanity defense, but his state of mind will be very important at the trial in September," Browne said. "We'll talk about his mental capacities or lack thereof, and other factors that were important to his state of mind."

The hearing is generating intense news media interest both in the United States and Afghanistan. By Tuesday, 16 news outlets had requested space at the hearing on the sprawling military base south of Tacoma, said Major Barbara Junius, a public information officer.

Joint Base Lewis-McChord is a an amalgamation of the Army's Fort Lewis and the Air Force's McChord Air Force Base. It supports more than 40,000 active-duty Guard and Reserve servicemembers. Bales worked on the base and lived about 30 miles west of it.

The hearing could inflame tensions in Afghanistan. In interviews with the Associated Press in Kandahar in April, relatives of the victims were outraged at the idea that Bales might escape the death penalty and vowed revenge.

"For this one thing, we would kill 100 American soldiers," said Mohammed Wazir, who had 11 family members killed that night, including his mother and 2-year-old daughter.

"A prison sentence doesn't mean anything," said Said Jan, whose wife and three other relatives were killed. "I know we have no power now, but I will become stronger, and if he does not hang, I will have my revenge." Three of Jan's other family members were wounded, including his 7-year-old granddaughter, who was shot in the head.