WASHINGTON - An appeals court resurrected the case Friday against four Blackwater Worldwide guards involved in a 2007 shooting in a Baghdad public square that killed 17 Iraqis.

A federal trial judge in Washington, Ricardo Urbina, threw out the case on New Year's Eve 2009 after he ruled that the U.S. Justice Department mishandled evidence and violated the guards' constitutional rights.

A three-judge panel of the U.S. Court of Appeals ruled Friday that Urbina wrongly interpreted the law. It ordered that he reconsider whether there was tainted evidence against four of the five defendants: former U.S. Marines Evan Liberty, Donald Ball and Dustin Heard; and Army veteran Paul Slough.

The Justice Department has dismissed charges against a fifth defendant, Nick Slatten, a former U.S. Army sergeant.

Blackwater security contractors were guarding U.S. diplomats when the guards opened fire in Nisoor Square, a crowded Baghdad intersection, on Sept. 16, 2007. Seventeen people were killed, including women and children, and 20 others were wounded in a shooting that inflamed anti-American sentiment in Iraq.

North Carolina-based Blackwater, which renamed itself Xe Services after the shooting, said the guards were innocent and had responded to an ambush by insurgents. Prosecutors said the shooting was unprovoked.

The United States rebuffed Iraqi demands that the U.S. contractors face trial in Iraqi courts. After a lengthy investigation, U.S. prosecutors charged the five contractors with 14 counts of manslaughter and took a guilty plea from a sixth, Jeremy Ridgeway. Urbina's dismissal outraged many Iraqis, who said that it showed Americans considered themselves above the law.

Hassan Jabir, a lawyer hit by gunfire in the deadly melee, described the appellate decision as a "big achievement for all those who were hurt by Blackwater's crime."

"It is in our benefit, and I'm very happy," Jabir told The Associated Press in a phone interview. "They must be convicted according to the Iraqi and American law."

The case against the five men fell apart because, after the shooting, the U.S. State Department ordered the guards to explain what happened. In exchange, the State Department promised the statements would not be used in a criminal case. Such limited immunity deals are common in police departments so officers involved in shootings cannot hold up internal investigations by refusing to co-operate.

The five guards told investigators they fired their weapons, an admission that was crucial because forensic evidence could not determine who had fired.

Because of the immunity deal, prosecutors had to build their case without those statements, a high legal hurdle that Urbina said the Justice Department failed to clear. Prosecutors read those statements, reviewed them in the investigation and used them to question witnesses and get search warrants, Urbina said. Important witnesses also reviewed the statements, and the grand jury heard evidence that had been tainted by those statements, the judge said.

Appellate judges Douglas Ginsburg, Merrick Garland and Stephen Williams ruled in a 17-page redacted review that Urbina "made a number of systemic errors based on an erroneous legal analysis." They ruled that Urbina excluded too much testimony and must reconsider for each defendant whether any evidence was tainted.

Defence attorneys declined to comment. Justice spokesman Dean Boyd said the department is pleased with the ruling and is assessing its next steps.