An appeals court Friday potentially revived the prosecution of four Blackwater Worldwide security guards accused of killing 14 Iraqis in a controversial shooting in a busy Baghdad square more than three years ago.

In a 17-page opinion, a three-judge panel of the U.S. Circuit Court of Appeals for the D.C. Circuit ruled unanimously that a federal judge misinterpreted the law in a 2009 ruling that dismissed all charges against the Blackwater guards.

Although Friday’s decision is a victory for the Justice Department, the ruling stopped short of clearing the way for the guards’ prosecution. Instead, the appeals court sent the case back to U.S. District Judge Ricardo M. Urbina to reconsider his earlier findings.

Dean Boyd, a spokesman for the Justice Department, said in a statement that prosecutors were pleased with the ruling and “assessing the next step.” Attorneys for the guards — Paul Slough of Keller, Tex.; Evan Liberty of Rochester, N.H.; Dustin Heard of Knoxville, Tenn., and Donald Ball of West Valley City, Utah — either could not be reached or declined to comment.

Legal experts said they were not sure how the judge would proceed or whether prosecutors will get the case before a jury. “This doesn’t guarantee that the case is alive again,” said Robert M. Chesney, a law professor at the University of Texas who specializes in national security matters. “But it makes that possible.”

The shooting, which badly strained Iraqi and U.S. relations, was the most serious one involving private security contractors in recent years, and it so badly tarnished the reputation of North Carolina-based Blackwater that the company renamed itself Xe Services.

At the time of the shooting, the four guards were providing security for diplomats under a State Department contract. On Sept. 16, 2007, they were part of a four-vehicle convoy that was securing an evacuation route for U.S. officials fleeing a nearby bombing when they opened fired in Baghdad’s Nisoor Square. By the time the shooting ended, at least 14 Iraqis were dead and 20 had been wounded. The guards told investigators that they opened fire in self-defense.

But after a lengthy investigation, federal prosecutors and FBI agents concluded that the shooting was an “unprovoked and illegal attack” on civilians. In 2008, five Blackwater guards were indicted on manslaughter and weapons charges. Prosecutors have since dropped charges against one of those guards. Another Blackwater contractor, Jeremy Ridgeway, has pleaded guilty to manslaughter charges and is cooperating with the government.

A year after the indictment, the case appeared to have evaporated when Urbina concluded that prosecutors and federal agents had used tainted evidence to obtain the indictment. The judge found that prosecutors had improperly used statements — given by the guards to the State Department in the hours and days after the shooting — to build their case. Those statements had been provided with the understanding that they would not be used against the guards in court.

In sending the case back to Urbina for reconsideration, appellate judges Douglas H. Ginsburg, Merrick B. Garland and Stephen F. Williams found that Urbina had “made a number of systemic errors based on an erroneous legal analysis” and had rejected too much evidence as having been tainted by the immunized statements. Urbina must now reassess that evidence.