Staff Sgt. Ivan L. "Chip" Frederick II, the highest-ranking of eight soldiers charged with abusing detainees at Abu Ghraib prison, was sentenced Thursday to eight years in prison, the stiffest punishment handed out so far in the scandal.

Frederick, 38, who pleaded guilty on Wednesday to eight counts of abusing and humiliating detainees in U.S. military custody, received the sentence under a plea deal with Army prosecutors in which he agreed to testify against other soldiers charged with abusing detainees at the prison last fall. Col. James Pohl, the military judge presiding over the court-martial, sentenced Frederick to 10 years in prison, but the lighter sentence negotiated with prosecutors is the one that the Army Reservist from Buckingham, Va., will serve.

Frederick also received a reduction in rank to private, forfeiture of pay and a dishonorable discharge.

Gary Myers, Frederick's civilian defense attorney, who helped negotiate the plea deal, called the sentence "excessive." Frederick had faced up to 18 years in prison.

The mistreatment by U.S. soldiers guarding and interrogating detainees at Abu Ghraib late last year was documented in photographs and videos that came to light six months ago. Frederick is one of seven soldiers from the Army's 372nd Military Police Company, based in Cresaptown, Md., to be charged with committing abuses at Abu Ghraib. He and Spec. Jeremy C. Sivits both have pleaded guilty. Sivits received a one-year prison sentence in May.

An eighth soldier, Spec. Armin J. Cruz Jr. of the 325th Military Intelligence Battalion, based in Devens, Mass., pleaded guilty last month and was sentenced to eight months in prison.

Frederick, who was in charge of the night shift at the prison wing where the abuses occurred, acknowledged in court Wednesday that he had hit, threatened and sexually humiliated detainees. He also told the judge that he knew his actions were wrong.

Frederick admitted forcing detainees to masturbate and helping attach wires to a detainee with the intention of making him think he might be electrocuted. He also pleaded guilty to punching a detainee in the chest so hard that a medic was called.

During the sentencing hearing on Thursday, Myers blamed the military for setting the conditions that allowed the abuse to take place and for failing to train Frederick properly. "Yes, this one individual has committed crimes. But there are essentially aiders and abettors who got him to that point," Myers said, apparently referring to Frederick's superiors.

But Maj. Michael Holley, the Army prosecutor, asked, "How much training do you need to learn that it's wrong to force a man to masturbate?" Holley added: "He never said he is sorry. I never heard him say he's sorry to the victims, to the United States Army or to anyone else."

On Wednesday, Frederick testified that some of his actions came at the direction of two interrogators employed by CACI International Inc., an Arlington-based government contractor.

He alleged that Steven A. Stefanowicz, a CACI interrogator, ordered him in mid-November to use dogs to threaten prisoners, telling him in one instance: "Treat 'em like [expletive]. Put the dog on this one if you can."

Stefanowicz had been named in an internal Army report as one of four people "directly or indirectly" responsible for abuses at the prison. Stefanowicz's attorney, Henry E. Hockeimer Jr., said all his client's actions were "appropriate and authorized."

"Mr. Stefanowicz vehemently denies the statements by Mr. Frederick regarding the use of dogs," he said. "These statements are made by someone who has admitted to serious and outrageous criminal wrongdoing and is desperately attempting to deflect attention from his own gross misconduct."

Frederick also testified that another CACI employee, whom he called "Mr. Johnson," ordered him to apply pressure under "the jaw, behind the ear or on the cheek" of Iraqi prisoners as they were being interrogated.

CACI released a statement that noted the denials by Stefanowicz's lawyer and said the "other individual is no longer employed by CACI."

Staff writer Ellen McCarthy in Washington contributed to this report.