A 101st Airborne Division soldier was sentenced Thursday to 18 years in prison for murdering a detainee and taking part in the killings of two others in Iraq last year.

Pfc. Corey R. Clagett, 21, was one of four soldiers from the division's 3rd Brigade "Rakkasans" who were accused in the detainees' deaths during a May 9 raid on the Muthana chemical complex in Samarra, about 60 miles north of Baghdad.

In an agreement with prosecutors, Clagett, of Moncks Corner, S.C., pleaded guilty to charges of murder, attempted murder, conspiracy to commit murder and conspiracy to obstruct justice. Prosecutors dropped a second obstruction charge and charges of disrespecting an officer and threatening.

The soldiers first told investigators they shot the detainees because they were attempting to flee — a story they now say they made up — and that commanders had given them orders to kill all military-age males on the mission.

Two of those soldiers, Spc. William B. Hunsaker and Spc. Juston R. Graber, have changed their stories and pleaded guilty. The squad leader, Staff Sgt. Raymond Girouard, is awaiting his court-martial.

"(Sgt. Girouard) said we were going to cut the zip ties loose and kill the detainees," Clagett told the military judge, Col. Theodore Dixon, on Thursday. "I knew it was an unlawful order. I just went along with it."

The judge asked Clagett what his intention was when he shot at the detainees.

"To kill them, your honor," Clagett said.

Clagett's lawyer, Paul Bergrin, has insisted Clagett was following orders, but sought the plea agreement after Hunsaker, 24, told a military judge that Clagett helped him shoot the detainees.

Clagett will also be demoted to private and dishonorably discharged. If he does not cooperate with prosecutors, he could be sentenced to life in prison with a chance at parole.

Military prosecutors would not discuss the case.