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

Col. Judge James Pohl, who presided over Frederick's case, also reduced Federick's rank to private, ordered him to forfeit his pay and had him dishonorably discharged.

Frederick's lawyer Gary Myers called the sentence "excessive" and said he intended to appeal. "We will seek to try to achieve a sentence reduction," according to a press pool report on the proceedings.

Frederick pleaded guilty Wednesday to taking part in the mistreatment, telling Pohl that he knew his actions were wrong at the time he committed them. As part of a plea bargain, Pohl sentenced Frederick to ten years but reduced it to eight.

In the deal with Army prosecutors, Frederick, who was in charge of the night shift in the prison wing where detainees were abused, pleaded guilty to eight of 12 criminal counts, including charges that he forced detainees to masturbate and helped attach wires to a detainee with the intention of making him think he might be electrocuted. The picture of that detainee -- hooded, naked and standing on a box -- was one of several that stirred an international scandal when they surfaced six months ago.

On Wednesday, Frederick, 38, told Pohl, that he knew he should not have been trying to scare the detainee. "I was wrong about what I did, and I shouldn't have done it," the Army reservist said. "I knew it was wrong at the time because I knew it was a form of abuse."

In the proceeding on Thursday, Army prosecutor Maj. Michael Holley told the court that it was a simple case of right and wrong. Frederick, said Holley, was "an adult capable of making decisions. . . . How much training do you need to learn that it's wrong to force a man to masturbate."

Frederick's lawyer, Myers, arguing for a lesser sentence, said that there the Army itself should take some of the blame for what happened. "Punish him yes. But please try to understand the defense's point of view that there is a corporate responsibility."

At the court-martial, Frederick testified that military intelligence and civilian interrogators set the stage for the abuses. They "would tell us what conditions to set for them -- keep their clothes, give them cigarettes."

"You took this as your role as an MP to set conditions for detainees?" Pohl asked.

"Yes, your honor," Frederick replied.

A former Iraqi detainee, the first to testify publicly at a court-martial about the abuse, said Frederick punched him and forced him to masturbate in front of other detainees who were "crying and screaming." Army officials asked that the man's name, which was entered into the court record, not be disclosed to protect him.

"I was crying," the former detainee said during the court-martial at Camp Victory, a large Army installation near Baghdad International Airport. "I wanted to kill myself."

He paused and put his head down on the stand for several minutes. The man, who had been detained for allegedly stealing a car and participating in a riot, said he was forced to sleep naked in a cell flooded with water.

"I felt humiliated but I had nothing to kill myself," the former detainee said Wednesday.

Frederick said an Army investigator responsible for interrogations encouraged him to abuse the detainee, saying he didn't care what was done to the prisoner "as long as you don't kill him."

Seven members of the Army's 372nd Military Police Company, based in Cresaptown, Md., have been charged in the scandal. Frederick and Spec. Jeremy C. Sivits have pleaded guilty. Sivits was sentenced in May to a year in prison; Frederick is expected to be sentenced this week and faces up to 18 years in prison.

An eighth soldier, Spec. Armin J. Cruz Jr., the only military intelligence soldier charged, pleaded guilty last month and was sentenced by Pohl to eight months in prison. Cruz was a reservist with the 325th Military Intelligence Battalion, based in Devens, Mass.

All three soldiers who pleaded guilty have agreed to testify against fellow soldiers in exchange for lighter sentences.

While Frederick's plea does not have any direct impact on pending cases, his testimony could be used at future courts-martial, possibly to bolster the argument by attorneys for other charged MPs that military intelligence interrogators encouraged the behavior that resulted in abuses.

The fact that Frederick was the most senior soldier involved in the abuses and that he accepted responsibility for taking part in them could carry even more weight in the pending cases. Lower-ranking soldiers facing criminal charges -- such as Pfc. Lynndie R. England, whose court-martial is scheduled to begin in January -- are expected to argue that they did what their superiors ordered them to do. England's attorneys have also suggested that the culture at Abu Ghraib encouraged and condoned such activities.

England's lead civilian attorney, Richard A. Hernandez, said he was pleased that Frederick entered a guilty plea because it made him available to testify at England's trial. He said he believed Frederick's testimony could only help his client. England's defense team has been arguing that she was following orders from higher-ranking soldiers at Abu Ghraib.

"The orders were passed down from above," Hernandez said. "This is what we have been saying all along."