The Justice Department settled a decades-old lawsuit on Tuesday filed by a group of men who were rounded up by the government in the weeks after the Sept. 11, 2001, attacks and held in a federal jail in New York in conditions the department’s own watchdog called abusive and harsh.

The settlement announced Tuesday calls for a $98,000 payout to be split among the six men who filed the suit and were held without terrorism charges at the Metropolitan Detention Center in Brooklyn.

The men — Ahmer Iqbal Abbasi, Anser Mehmood, Benamar Benatta, Ahmed Khalifa, Saeed Hammouda and Purna Raj Bajracharya — said they were detained in restrictive conditions and, in some cases, abused by members of the staff.

The settlement is somewhat unusual because federal courts at nearly every level, including the Supreme Court, had thrown out large chunks of the lawsuit. A federal district court judge threw out the remaining part of the suit last year. The plaintiffs filed an appeal, but there had been little action in the case for months.

Though the Justice Department does not admit guilt as part of the settlement agreement, Bureau of Prisons Director Michael Carvajal wrote a letter to each of the men saying the Justice Department had determined they were “held in excessively restrictive and unduly harsh conditions of confinement and a number of individuals were physically and verbally abused by certain MDC officers.”

The letter went on to say that “Under the exceptional circumstances of this unique case and before the facts have been fully litigated or there has been any final judgment by the court in this case the Federal Bureau of Prisons has agreed to provide funds to the former Warden of the MDC, Dennis Hasty, to indemnify him for the settlement of your claims. This will resolve all of your claims in this litigation.”

“I don’t know that the director of the Bureau of Prisons has ever signed a letter of this nature before to individual clients, so that is unique,” said Rachel Meeropol, senior staff attorney with the Center for Constitutional Rights, who represents the men.

Meeropol called the court battle a failure of the justice system, pointing to limitations on claims against federal officials.

“Under the court actions, there’s no way people for people who have been injured to get justice,” Meeropol said in an interview with The Associated Press. “Instead, we’re seeing this pretty amazing work around with the defendants finding a way to make themselves be held responsible when the court said no. I think it’s a unique acknowledgment of this situation and the way that what happened were procedural obstacles to true justice.”

The Justice Department did not immediately comment.

The lawsuit originally sought accountability from high-level members of the George W. Bush administration, and a settlement was reached in 2008 with the original five plaintiffs. Others were added.

In 2017 the Supreme Court threw out parts of the suit but tossed one claim, against the former warden of the federal lockup, back to a lower court. A federal judge in Brooklyn dismissed the remaining parts of the suit last year, finding that the men did not have the right to sue for their injuries, though the judge did not address whether there were constitutional violations.

The settlement closes a chapter on a troubling era in federal criminal justice when Muslim, Arab and South Asian men were rounded up in the days and weeks after the September 11 attacks. Soon, more than 1,000 were arrested in sweeps across the New York metropolitan area and nationwide. Most were charged only with overstaying visas and deported back to their home countries. But before that happened, many were held in detention for months, with little outside contact, especially with their families.

They were, according to the 9/11 Commission report, arrested as “special interest” detainees. Immigration hearings were closed, detainee communication was limited, and bond was denied until the detainees were cleared of terrorist connections. Identities were kept secret.

A review conducted by the Justice Department’s inspector general said the Justice Department’s “hold until cleared” policy meant a significant percentage of the detainees stayed for months despite immigration officials questioning the legality of the prolonged detentions and even though there were no indications they were connected to terrorism. Compounding that, they faced “a pattern of physical and verbal abuse” particularly at the federal jail in Brooklyn. Conditions were, the report said, “unduly harsh.”

“I am glad that the case is coming to an end after two decades of litigation. However, it is a bittersweet conclusion for me,” said Benatta, in a statement released by the Center for Constitutional Rights, one of the plaintiff attorneys, along with Covington & Burling LLP, and attorneys Michael Winger and Alexander Reinert.

“I don’t believe justice is properly served, considering the detrimental consequences the defendants’ actions have had on my life,” he said. “I can’t help but feel let down by the whole judicial system – federal courts had the opportunity to remedy the situation but chose not to intervene, and, by doing so, they left the door open for future mistreatment and abuse to take place without any ramifications.”