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.