A US appeals court on Wednesday reinstated a claim against former attorney general John Ashcroft and other Justice Department officials, stemming from the abuse of Arab and Muslim men and others detained for months in New York and New Jersey after the September 11 attacks.

The unusual decision cleared the way for once-anonymous plaintiffs to advance charges that the top officials in the Justice Department had violated their constitutional guarantees of equal protection under the law. The suit seeks class-action status for all detainees similarly abused.

A lower court had found that Ashcroft and his co-defendants, former FBI director Robert Mueller and former INS commissioner James Ziglar, had not been sufficiently linked to the abuse of detainees to support the plaintiffs’ claims.

In its reversal of that decision, the US court of appeals for the second circuit asserted that the justice department officials had put policies into place that were conducive to the abuse, that they knew the abuse was happening and that they knew the detainees weren’t terrorism suspects.

“It might well be that national security concerns motivated the defendants to take action, but that is of little solace to those who felt the brunt of that decision,” the court wrote. “The suffering endured by those who were imprisoned merely because they were caught up in the hysteria of the days immediately following 9/11 is not without a remedy.”

Ashcroft was attorney general from 2001 to 2005, during the first term of president George W Bush. Mueller ran the FBI from 2001 to 2013.

The case was first brought 13 years ago by the Center for Constitutional Rights, a New York-based nonprofit. “We are thrilled with the court’s ruling,” said CCR senior staff attorney Rachel Meeropol in a statement. “The court took this opportunity to remind the nation that the rule of law and the rights of human beings, whether citizens or not, must not be sacrificed in the face of national security hysteria.”

The current complaint is joined by eight named plaintiffs, all of whom were caught up in law enforcement sweeps that netted hundreds of men after the 9/11 attacks. The “9/11 detainees” had in common an unresolved immigration status and a perceived Arab or Muslim background, although others were also targeted.

A justice department inspector general’s report in 2003 detailed the mistreatment of the detainees. Under a “hold-until-cleared” policy implemented by Ashcroft, no such detainee was to be released until the FBI cleared the detainee of links to terrorism.

The result, in some cases, was months of detention without charges, abuse at the hands of guards, solitary confinement and other punitive measures. The complaint details gratuitous strip searches, beatings, broken bones and verbal abuse. In one case, a Buddhist from Nepal who had lived in the United States for five years was arrested for filming a Queens street, and held and abused in a Brooklyn detention center for three months.

In another, a Pakistani father of four was arrested at his New Jersey home after his wife’s brother’s name came up in a separate investigation. The father convinced agents to take him instead of his wife because his youngest child was still breastfeeding. He was beaten up, thrown into walls, shackled and threatened with death during four months in custody.

The appeals court found those measures to be “punitive and unconstitutional”.

“Discovery may show that the defendants—the [Department of Justice] defendants, in particular – are not personally responsible for detaining Plaintiffs in these conditions,” the 2nd circuit ruling said. “But we simply cannot conclude at this stage that concern for the safety of our nation justified the violation of the constitutional rights on which this nation was built.”