Joint Base Lewis-McChord, Washington (CNN) -- "The plan was to kill people."

That's what Army Spc. Jeremy Morlock said Wednesday moments after he pleaded guilty at a court-martial proceeding to killing Afghan civilians in 2010.

Lt. Col. Kwasi Hawks, the military judge in the case, had asked Morlock if he and fellow soldiers just meant to scare civilians with grenades and gunfire and it "got out of hand."

Morlock, 22, and four other soldiers who face murder charges are accused of killing Afghan citizens for sport. Seven more soldiers are accused of helping cover up the killings.

Morlock also pleaded guilty to drug charges. He has pleaded not guilty to charges that he struck another soldier and that he photographed and possessed photos of dead Afghans.

Morlock was charged with three counts of murder.

Hawks accepted Morlock's guilty plea, but sentencing will take place later.

The defendant addressed the court, saying, "I want to apologize to the families of my victims, the people of Afghanistan and my fellow soldiers."

The Wasilla, Alaska, native said he has been reflecting "on how I lost my moral compass."

Morlock told the judge he pleaded guilty in hopes of receiving a lesser sentence. The defendant, who could have been sentenced to life in military prison without the possibility of parole, agreed to testify against other soldiers.

Morlock must now serve the remainder of a 24-year prison sentence and could be paroled in seven years. The judge counted the year Morlock has already spent in confinement toward his sentence and parole eligibility date.

Morlock's attorney, Frank Spinner, told the court his client "has admitted responsibility for what he did."

"No one takes pleasure in testifying against others," Spinner said. "He plans to testify truthfully."

Morlock was accused of killing one Afghan civilian in January 2010 with a grenade and rifle; killing another in May 2010 in a similar manner; and shooting a third to death in February 2010.

Another soldier, Pfc. Andrew Holmes, also faces charges in the case, but a start date for his court-martial has not been publicly announced.

In all, officials charged 12 U.S. soldiers in what they called a conspiracy to kill Afghan civilians and cover it up, along with charges they mutilated corpses and kept grisly souvenirs.

Morlock was the first of the five to face an Article 32 hearing, the military equivalent of a grand jury hearing, at Joint Base Lewis-McChord.

Holmes is charged with the premeditated deaths of three civilians, possessing a dismembered human finger, wrongfully possessing photographs of human casualties and smoking hashish.

He is also accused of conspiring with Morlock to shoot at a civilian and then toss a grenade so it would look like the soldiers were under attack.

All the accused men were members of a 2nd Infantry Division brigade operating near Kandahar in southern Afghanistan in 2009 and 2010.

The three others facing murder charges are Staff Sgt. Calvin Gibbs, of Billings, Montana; Adam Winfield, of Cape Coral, Florida; and Spc. Michael Wagnon, of Las Vegas.

Authorities allege Gibbs kept finger bones, leg bones and a tooth from Afghan corpses. Wagnon allegedly kept a skull from a corpse, according to charging documents.

Several soldiers are charged with taking pictures of the corpses, and one soldier is charged with stabbing a corpse.

This week, German news outlet Der Spiegel published photographs of what they identified as Morlock and Holmes posing over the bodies of dead Afghans.

Two images show the soldiers kneeling by a bloody body sprawled over a patch of sand and grass. A third shows what appears to be two bodies propped up, back to back, against a post in front of a military vehicle.

The U.S. Army released a statement Monday calling the photographs "repugnant to us as human beings and contrary to the standards and values of the United States Army."

"We apologize for the distress these photos cause," the statement said.

Army officials asserted in the statement that ongoing court-martial proceedings related to the alleged atrocities "speak for themselves."

"The photos appear in stark contrast to the discipline, professionalism and respect that have characterized our soldiers' performance during nearly 10 years of sustained operations."