A U.S. appeals court on Friday threw out the first-degree murder conviction of a former Blackwater Worldwide security guard sentenced to life in prison in the killings of 14 unarmed Iraqi civilians in a Baghdad traffic circle in 2007.

The court also ordered resentencings for three others convicted in the incident.

The September 2007 shootings, which also wounded 17 people, fomented deep resentments about the accountability of American security forces during one of the bloodiest periods of the Iraq War.

The three-judge panel of the U.S. Court of Appeals for the District of Columbia Circuit ruled that the trial court “abused its discretion” in not allowing Nicholas A. Slatten, 33, of Sparta, Tenn., to be tried separately from his three co-defendants, even though one of them said he, not Slatten, fired the first shots in the civilian massacre.

In a split ruling, the court also found that the 30-year terms of the others convicted of manslaughter and attempted manslaughter — Paul A. Slough, 37, of Keller, Tex.; Evan S. Liberty, 35, of Rochester, N.H.; and Dustin L. Heard, 36, of Maryville, Tenn. — violated the constitutional prohibition against “cruel and unusual punishment.”

They received the enhanced penalty because they were also convicted of using military firearms while committing a felony, a charge that primarily has been aimed at gang members and never before used against security contractors given military weapons by the U.S. government.

“While we believe at a minimum that Mr. Heard should have been awarded a new trial in this matter, we are gratified that the Court recognized the gross injustice of the 30-year mandatory minimum sentences,” Heard’s attorney, David Schertler, said in a statement. Attorneys for the three other men did not respond to interview requests.

Slough's wife, Christin, said while she was thrilled Slatten's conviction was vacated, the ruling deepened her distrust of the federal judicial system. "We remain hopeful that all four of these men will be home where they belong sooner rather than later, but this was not the firm step in that direction that we had hoped or that the law required," she said.

On social media, a group representing friends and family of the four tweeted, “Not a complete home-run for all 4 men, but it is something.”

It could not immediately be determined whether Slatten would be retried. Spokesmen for the U.S. Justice Department and U.S. Attorney Channing D. Phillips said Phillips’s office “is reviewing the opinion and has no further comment at this time.”

The four contractors were convicted of firing wildly into cars stalled in midafternoon traffic at Nisour Square on Sept. 16, 2007, pouring machine-gun bullets and grenades into crowds, including women clutching only purses and children holding their hands in the air.

The U.S. government sought to make amends to its Iraqi allies, but the U.S. refusal to allow the men to be tried in Iraq sent relations between the countries into a crisis, and the Blackwater name became shorthand for unaccountable U.S. power.

The Pentagon subsequently cracked down on contractors and scaled back their use, but it continues to rely on thousands of hired workers in war zones. They include more than 23,000 in Afghanistan and upward of 5,000 in Iraq. Some are employed as cooks and in other unarmed capacities, while others fill key security roles such as escorting diplomats and protecting convoys.

In overturning the 30-year terms, Circuit Judges Karen LeCraft Henderson and Janice Rogers Brown wrote that “we by no means intend to minimize the carnage attributable to Slough, Heard and Liberty’s actions. Their poor judgments resulted in the deaths of many innocent people.” But they said the sentencing judge — U.S. District Judge Royce C. Lamberth of the District — should tailor more “nuanced” penalties based on each defendant’s wrongdoing rather than using a “sledgehammer.”

Circuit Judge Judith W. Rogers disagreed, saying the claim “lacks any merit whatsoever,” calling the 30-year terms “appropriate” for the crime and noting that other security guards chose not to fire their weapons at all that day.

An Iraqi official at the embassy in Washington, who was not authorized to speak by name, said Friday that the shootings are “still raw after all these years” and were an “egregious atrocity that these people committed.”

Prosecutors said the four defendants, among 19 Blackwater guards providing security for State Department officials in Iraq, panicked and were out of control when they fired after one of them falsely claimed that their convoy, called Raven 23, was threatened by a car bomber.

The guards said that they acted in self-defense after coming under AK-47 gunfire as they cleared a path to the nearby Green Zone for another Blackwater team evacuating a U.S. official from a car bombing.

During the 10-week trial in 2014, no witness testified that they saw the guards come under fire, nor was evidence found that AK-47 rifles carried by Iraqi insurgents were used.

The defendants had vowed to appeal what one called a “perversion of justice,” saying they fired in self-defense in a war zone and a city that was then one of the world’s most dangerous places.

At sentencing, Lamberth, a former Army captain who was appointed to the federal bench by President Ronald Reagan, said the defendants, all U.S. military veterans, “appear to be overall, good, young men who have never been in trouble” and “just panicked.”

But Lamberth said the acts could not be condoned by a court. “A court has to recognize the severity of the crimes committed, including the number of victims.”

Lamberth acknowledged criticism that the 30-year firearms penalty was excessive, sentencing Heard, Liberty and Slough to time served on their other convictions as their attorneys requested. But Lamberth also said he expected he could resentence them upward if the 30-year terms were overturned.

By a 2-to-1 vote, the three-judge appeals panel did just that, finding that prosecutors misapplied a law Congress originally aimed at violent drug traffickers to security contractors with no prior criminal record, resulting in a punishment “grossly disproportionate to their culpability for using government-issued weapons in a war zone.”

The ruling, however, delivered a separate victory for the government, upholding that civilian contractors supporting the Pentagon could be prosecuted under the Military Extraterritorial Jurisdiction Act.

The defense had argued that the act applied only to contractors directly employed by the Defense Department. Congress had broadened the law in 2004 to cover civilians in the wake of atrocities by non-Defense contractors at Abu Ghraib prison in Baghdad.

The appeals judges saved their toughest criticism for Slatten’s prosecution, ruling that Lamberth should not have excluded statements by an unnamed co-defendant who, when first interviewed in the immediate aftermath of the shootings under immunity from State Department investigators, said that he, not Slatten, fired the first shots that killed a sedan driver near the convoy, setting off the massacre.

“The co-defendant’s statements contradict the core of the homicide count against Slatten,” premeditated murder, the appeals court wrote. “It was an abuse of discretion to deny Slatten’s motion to sever” their trials, the court wrote, because trying Slatten with that co-defendant meant the co-defendant’s statements could not be admitted to aid Slatten.

Gabor Rona, visiting professor at the Cardozo School of Law at Yeshiva University in New York and chairman of a United Nations working group on mercenaries, called the ruling an “excellent case in point” for the need for more international regulation of the private security industry, perhaps through an international treaty that the U.S. government has opposed.

“This is exactly the wrong way to pursue foreign policy. Creating private armies to fight wars for states is medieval, and contrary to any reasonable interpretation of what’s good for the United States and what is good for human rights,” Rona said.

The North Carolina-based security firm’s founder, Erik Prince, eventually left the company, which was renamed Xe Services, then later sold and renamed Academi.

Lynh Bui, Rachel Weiner and Thomas Gibbons-Neff contributed to this report.