A federal judge on Tuesday ordered a new trial for five former New Orleans police officers convicted of civil rights violations stemming from deadly shootings on a bridge after Hurricane Katrina, concluding the case had been tainted by “grotesque prosecutorial misconduct.”

In a 129-page ruling, U.S. District Judge Kurt Engelhardt said at least three government attorneys posted anonymous comments on a New Orleans newspaper’s website, creating a “carnival atmosphere” that “distorted and perverted” justice in the case.

“The public must have absolute trust and confidence in this process,” he wrote. “Re-trying this case is a very small price to pay in order to protect the validity of the verdict in this case, the institutional integrity of this court, and the criminal justice system as a whole.”

Less than a week after Katrina’s 2005 landfall, police shot and killed two unarmed people and wounded four others on the Danziger Bridge. Five former officers cooperated with a Justice Department investigation and pleaded guilty to engaging in a cover-up to make the shootings appear justified.

After a jury convicted five other former officers in 2011, their attorneys argued that prosecutors’ online comments and leaks to news organizations were part of a “secret public relations campaign” that deprived their clients of a fair trial.

Engelhardt granted their request for a new trial, though he called it a “bitter pill to swallow.”

“The government’s actions, and initial lack of candor and credibility thereafter, is like scar tissue that will long evidence infidelity to the principles of ethics, professionalism, and basic fairness and common sense necessary to every criminal prosecution, wherever it should occur in this country,” he wrote.

Former police Sgts. Kenneth Bowen and Robert Gisevius, and former officers Anthony Villavaso and Robert Faulcon had been convicted of charges related to the shooting and cover-up. Retired Sgt. Arthur “Archie” Kaufman, who was assigned by the police department to investigate the case, wasn’t charged in the shootings but was convicted of orchestrating the cover-up. Engelhardt sentenced them to prison terms that ranged from six to 65 years. All five are serving those sentences.

Villavaso’s attorney, Tim Meche, said he hopes the Justice Department re-evaluates whether the case should be retried. “The judge’s opinion validates our belief that this case was a perversion of justice,” Meche said.

Justice Department spokeswoman Dena Iverson said prosecutors were disappointed with the ruling.

“We are reviewing the decision and considering our options,” she said in a statement.

Prosecutors said Faulcon fatally shot 40-year-old Ronald Madison, a mentally disabled man, in the back on the west side of the bridge as he and his brother ran away from the gunfire on the east side of the bridge, where 17-year-old James Brissette had been shot and killed by police.

Romell Madison, one of Ronald’s brothers, said the family is “extremely disappointed” and urged the Justice Department to appeal the judge’s ruling.

“This decision re-opens this terrible wound not only for our family but our entire community,” he said in a statement. “From the beginning of this ordeal our family has sought justice, not just for ourselves, but for all the victims and families.”

Former U.S. Attorney Jim Letten resigned in December 2012 after two of his top deputies — Sal Perricone and Jan Mann — acknowledgeded they had posted anonymous comments on nola.com, the Times-Picayune’s companion website, about cases their office had handled, including the Danziger Bridge investigation.