It has been nearly 14 years since the 9/11 attacks, but a lawsuit on behalf of Muslims rounded up in the aftermath has barely moved forward as lawyers try to show how frightening it was for hundreds of men with no ties to terrorism to be treated like terrorists, locked up and abused for months at a time.

The lawsuit finally got the go-ahead from a federal appeals court last week, with two judges willing to let the courts grapple with what happened when the largest criminal probe in US history tested the boundaries of civil liberties.

In a 2-1 ruling, the second US circuit court of appeals reinstated the lawsuit against three former top US officials, including then attorney general John Ashcroft and FBI director Robert Mueller.

Holding the defendants “in solitary confinement 23 hours a day with regular strip searches because their perceived faith or race placed them in the group targeted for recruitment by al-Qaida violated the detainees’ constitutional rights”, the majority 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.”

The ruling gives hope that what really happened at the top layers of US government can be learned, said Rachel Meeropol, a Center for Constitutional Rights attorney working on the case.

“Frankly,” she said, “while this decision is only an interim victory, and doesn’t provide my clients with any actual compensation, its bold rebuke to unchecked executive power is itself worth the years of effort.”

In all, 762 detainees were swept up nationwide, including 491 in the New York area. The arrests came after the FBI was flooded with tips to a hotline, including 96,000 in the week after 11 September 2001.

Some were held an average of three to eight months in New York, with about 80 housed at the metropolitan detention center in Brooklyn and the rest at the Passaic County jail in Paterson, New Jersey.

The court described evidence showing detainees’ abuse included slamming them into walls; bending or twisting their arms, hands, wrists and fingers; stepping on their leg restraints; leaving them handcuffed or shackled in their cells; and insulting their religion or making humiliating sexual comments during strip searches.

One detainee came to the FBI’s attention when his landlord called the agency and reported “that she rented an apartment in her home to several Middle Eastern men, and she ‘would feel awful if her tenants were involved in terrorism’ and she didn’t call”, the appeals court said.

Another was arrested after the FBI received a tip that a small grocery store where he worked was overstaffed, arousing his suspicions about the “Middle Eastern men” who worked there, the judges noted.

Yet another told his lawyers that when he complained to FBI agents that guards were abusing him, the agents “stated it was because he was a Muslim”, they added.

In a dissent, circuit judge Reena Raggi warned her colleagues that the judiciary should step carefully into areas of national security.

“It is difficult to imagine a public good more demanding of decisiveness or more tolerant of reasonable, even if mistaken, judgments than the protection of this nation and its people from further terrorist attacks in the immediate aftermath of the horrific events of 9/11,” she wrote.

The lawsuit filed in Brooklyn federal court in April 2002 now has eight plaintiffs, including six Muslims, a Hindu and a Buddhist. All are of Middle Eastern, north African or south Asian origin. Each was deported after being cleared of any connection to terrorism.

The progress of the lawsuit has been stymied by several developments, including a $1.26m settlement by five earlier plaintiffs who now live overseas, a supreme court decision that set new legal standards and a report by the Office of the Inspector General of the US justice department that lent support to the lawsuit’s claims.

Justice department spokeswoman Nicole Navas said on Friday only that the ruling was being reviewed.

Lee Gelernt, an American Civil Liberties Union lawyer who argued another case before the supreme court regarding someone detained as a material witness in a terrorism-related criminal case, said the second circuit ruling would have an impact.

“These types of rulings are not lost on high-level officials no matter when they occur,” he said. “Just merely making high-level officials stand trial has a deterrent effect because they will now have to justify their actions.”

Meeropol said her clients could have resolved the case years ago if they had sued only local prison officials, but they and other former detainees believed it was important to hold top US officials accountable.

“If they aren’t held accountable, there is nothing to stop them from doing it again,” she said.