BAGHDAD — A former American soldier who is accused of raping a 14-year-old Iraqi and killing her and three members of her family told fellow soldiers that "all Iraqis are bad people" after his unit began taking casualties, according to testimony in an American military hearing on Sunday.

The former soldier, Steven D. Green, a private who was discharged in May after a psychiatric evaluation, also sought help for combat stress while deployed in Iraq, according to his former battalion commander, Lt. Col. Thomas Kunk.

Colonel Kunk was one of four witnesses who testified Sunday. The hearing, which is expected to continue for several days, is the latest chapter in the prosecution of the case involving Mr. Green and five active-duty soldiers, all of whom are accused of involvement in the rape and killings on March 12 in the town of Mahmudiya, south of Baghdad.

The case, one of several recent ones in which American soldiers have been accused of killing unarmed Iraqi civilians, has embarrassed the American military, infuriated Iraqis and strained relations between American authorities in Baghdad and their Iraqi counterparts.

The hearing in Baghdad, conducted under Article 32 of the Uniform Code of Military Justice, is roughly equivalent to a grand jury proceeding and will determine whether there is enough evidence to convene a court-martial to try the five active-duty soldiers.

Specialist James P. Barker, Pfc. Jesse V. Spielman, Pfc. Bryan L. Howard and Sgt. Paul E. Cortez have been accused of rape, murder and arson - military prosecutors say they set the girl's body on fire to conceal evidence.

The fifth soldier in the hearing, Sgt. Anthony W. Yribe, is accused of dereliction of duty for not reporting the crimes, but he is not thought to have been at the house where the crimes are said to have taken place.

Mr. Green faces rape and murder charges in a federal court in Kentucky. He has pleaded not guilty to the charges.

In his testimony, Colonel Kunk said the soldiers' company - Company B of the First Battalion, 502nd Infantry, with the 101st Airborne Division - had a particularly dangerous assignment to patrol a stronghold of the Sunni Arab insurgency south of Baghdad. The job took a high toll, with eight of the company's soldiers killed from September through June.

Mr. Green and two of the accused soldiers, Private Spielman and Sergeant Cortez, were "wallowing in self-pity" early in the year amid the violence and the death of fellow soldiers, Colonel Kunk said. They were among several soldiers who sought help for combat stress, he said.

An error has occurred. Please try again later.

You are already subscribed to this email.

Colonel Kunk said at the hearing that others had told him about Mr. Green's comment, "all Iraqis are bad people." He was so concerned about it that he personally discussed it with Mr. Green, he said, asking him whether he intended to kill Iraqis.

But during the hearing, the line of questioning turned and Colonel Kunk never testified about Mr. Green's response.

Earlier in the day, an Iraqi Army medic described a gruesome tableau of violence he encountered when he walked into the house where, according to investigators, the rape and killings took place.

The medic, who testified anonymously for security reasons, said he found the naked and burned body of the girl with a bullet hole in her face and saw the bullet-ridden bodies of her sister and parents - a scene that left him "sick for almost two weeks," he said.

Two Iraqi witnesses also took the stand, but reporters were barred from hearing them, and officials did not disclose details of their testimony. A trial lawyer had requested the restriction out of concern that public exposure might endanger them.

The hearing took place on another day of scattered violence around Iraq.

Three American soldiers were killed Sunday by an improvised bomb planted along a road southwest of Baghdad, the American military said in a statement early Monday.

A suicide bomber wrapped in explosives detonated himself in the middle of a crowd of mourners attending the funeral of a member of the Tikrit city council, an Interior Ministry official said. Five people were killed and 15 wounded, the official said.

At least 15 bodies, all with their hands tied behind their backs and gunshots to the head, were found in different Baghdad neighborhoods, according to the ministry official.