U.S. Court of Appeal for the Ninth Circuit.

A federal appeals court ordered a California trial judge Wednesday to review whether the U.S. government acted in bad faith in a case involving a Muslim woman’s erroneous placement on a “no fly” list.

The U.S. Court of Appeals for the Ninth Circuit, sitting en banc, lambasted the government’s conduct in the case of Dr. Rahinah Ibrahim, a Malaysian national and now-Stanford University doctorate, who was wrongly placed on a “no fly” list in 2004. That move—and her 2005 detention in a San Francisco airport—spurred a yearslong legal fight between Ibrahim’s civil rights lawyers at San Jose firm McManis Faulkner and the government.

Agencies named in the lawsuit included the Department of Homeland Security, the National Counterterrorism Center, and the State Department.

The panel’s majority, in an opinion written by Judge Kim McLane Wardlaw, said the U.S., during that legal fight, “played discovery games, made false representations to the court, misused the court’s time, and interfered with the public’s right of access to trial.” The panel directed U.S. District Judge William Alsup in San Francisco to recalculate attorney fees he earlier awarded the firm. It also said Alsup’s determination that the government had not acted in bad faith “was in error because it was incomplete.”

“Dr. Ibrahim should not have had to endure over a decade of contentious litigation, two trips to the court of appeals, extensive discovery, over 800 docket entries amounting to many thousands of pages of record, and a weeklong trial the government precluded her (and her U.S.-citizen daughter) from attending, only to come full circle to the government’s concession that she never belonged on the No Fly list at all—that she is not and never was a terrorist or threat to airline passenger or civil aviation security,” Wednesday’s opinion said.

“It should not have taken a court order to require the government to ‘cleans[e] and/or correct[] … the mistaken 2004 derogatory designation’ of Dr. Ibrahim, which had spread like an insidious virus through numerous government watchlists,” Wardlaw wrote.

The majority took specific aim at the government’s “stubborn refusal” to turn over discovery despite a court order, and said the government “continued to drag its feet” on producing privilege information that Ibrahim’s attorneys were cleared to review. Wardlaw said the government also refused to initially comply with a court order to disclose Ibrahim’s current watch list status.

Judge Consuelo Callahan, joined by Judges N. Randy Smith and Jacqueline Nguyen, concurred in part and dissented in part from the panel’s opinion, arguing the en banc panel should have affirmed the district court’s limits to Ibrahim’s attorney fees.

Callahan said the majority overstepped its role as an appeals court by finding that the government’s position was not substantially justified. Callahan also said Ibrahim failed to show clear error in the district court’s finding that the government had not acted in bad faith.

Jim McManis, a name partner at McManis Faulkner, said he was thrilled by the panel’s ruling.

“We’ve had this case for over 10 years, had a lot of good lawyers working hard, and I’m just very pleased, after all these years fighting the federal government, the court has recognized the good work these folks did and agrees we should be properly compensated,” he said.

The Justice Department declined to comment.

Read more:

Federal Workers Sue Over Pay Denied During Ongoing Shutdown

Judge Rules State AGs ACA Lawsuit May Proceed Despite Government Shutdown

Texas Judge Stays His ACA Ruling, but Adds an Appeal Is Unlikely to Succeed