CAMP PENDLETON, Calif. - An officer who saw the corpses of Iraqi women and children sprawled across a bed in a home said Wednesday in recorded testimony that he thought that "my Marines were doing the right thing" when they killed them.

Marine 1st Lt. Max Frank, whose deposition was recorded in March before his return to Iraq, was the first witness to be heard at a preliminary hearing for Lt. Col. Jeffrey Chessani, the commander of the Marine battalion involved in the deadly sweep of the village of Haditha.

The sweep led to the deaths of 24 people on Nov. 19, 2005, after a roadside bomb killed a lance corporal driving a Humvee. In the aftermath, Marines went house to house looking for insurgents.

"From my perspective at the time, my assumption was my Marines were doing the right thing," Frank said. "I rationalized it to myself as they were taking fire. The Marines could have come in, yelled at them to come out, and when they didn't come out they cleared the room with a fragmentation grenade."

Frank, a platoon commander, said he saw a total of 24 bodies, including five men who had been shot beside a white car, an elderly man whose leg had been maimed, and a woman and child curled up in another house.

Chessani, 43, is charged with dereliction of duty on suspicion of failing to investigate the killings. He is the highest-ranking of seven Marines accused in the case.

The Marines have said they thought they were taking fire from the houses. They used fragmentation grenades and machine guns to clear the houses, but instead of hitting insurgents, they killed civilians.

Frank testified that he and another Marine loaded the corpses into Humvees. No one else wanted to perform the task, because there was a shortage of corpse-handling gloves and body bags. The bodies were first taken to a Marine base and then to the morgue in Haditha, where one Iraqi hospital worker vomited when he saw the corpses, Frank testified.

Frank is one of several Marines given immunity to testify. He said the consensus at the time was that the Iraqis died as the result of an insurgent-initiated attack, so there was no need to investigate the deaths further.

The Article 32 hearing, similar to a civilian grand jury proceeding, will determine whether Chessani stands trial on charges of dereliction of duty and violating a lawful order for failing to investigate the deaths of the men, women and children. If convicted, he faces up to three years in prison.

Chessani had inspected the scene after the Nov. 19, 2005, killings and "saw no law-of-war violation," said his lawyer Brian Rooney. He said Chessani immediately reported to his boss, the commanding officer for the 2nd Marine Regiment.