A US marine accused of killing unarmed Iraqi women and children in 2005 has pleaded guilty to dereliction of duty, reaching a plea deal and ending the largest and longest-running criminal case against US troops to emerge from the Iraq war.

Staff sergeant Frank Wuterich led the marine squad in 2005 that killed 24 Iraqis in the town of Haditha after a roadside bomb exploded near a marine convoy, killing one marine and wounding two others.

Wuterich's plea interrupted his trial at Camp Pendleton before a jury of all combat marines who served in Iraq.

Wuterich faces a maximum of three months confinement, two-thirds forfeiture of pay, and a rank demotion to private when he is sentenced, likely to be Tuesday.

The issue at the court martial was whether Wuterich reacted appropriately as a marine squad leader in protecting his troops in the midst of a chaotic war, or disregarded combat rules and ordered his men to shoot and blast indiscriminately at Iraqi civilians. Wuterich was charged with nine counts of manslaughter, among other charges, and is one of eight marines initially charged. None has been convicted.

Prosecutors said he lost control after seeing the body of his friend blown apart by the bomb and led his men on a rampage in which they stormed two nearby homes, blasting their way in with gunfire and grenades. Among the dead were women, children and elderly people, including a man in a wheelchair.

Wuterich's former squad members testified that they did not take any gunfire during the 45-minute raid on the homes nor find any weapons, but several squad members testified that they do not believe they did anything wrong, fearing insurgents were inside hiding.

The prosecution was further hurt by the testimony of Wuterich's former platoon commander who said the squad was justified in its actions because house was declared "hostile," and from what he understood of the rules of combat at the time that meant any use of force was allowed and marines did not need to positively identify their targets.

Wuterich has said he regretted the loss of civilian lives but believed he was operating within military combat rules.

After Haditha, US marine commanders ordered troops to try and distinguish between civilians and combatants.

The killings in Haditha on November 19 2005, still fuel anger in Iraq, and were the primary reason behind demands that US troops not be given immunity from their court system. It is considered among the war's defining moments, further tainting America's reputation when it was already at a low point after the release of photos of prisoner abuse by US soldiers at Abu Ghraib prison.

The trial was delayed for years by pre-trial wrangling between the defense and prosecution, including over whether the military could use unaired footage from an interview Wuterich gave in 2007 to the CBS show 60 Minutes. Prosecutors eventually won the right to view the footage

Six squad members have had charges dropped or dismissed, including some in exchange for testifying at the trial. One was acquitted.