John Ashcroft had asked the court to dismiss the case
A former US attorney general can be sued by an American citizen held as a witness suspected of having information in a terrorism case, a court has ruled.
Abdullah al-Kidd accuses John Ashcroft, attorney general from 2001 to 2005, of violating his constitutional rights in 2003, when he was held for 16 days.
The court said detention of witnesses without charge after the 9/11 attacks was "repugnant to the constitution".
The US Department of Justice said it was reviewing the court's order.
A three-judge panel of the 9th US Circuit Court of Appeals also said the government's policy was "a painful reminder of some of the most ignominious chapters of our national history."
Mr al-Kidd was detained in 2003 because the government thought he had information in a computer terrorism case against fellow University of Idaho student Sami Omar al-Hussayen.
He was never charged with a crime, and Mr al-Hussayen was acquitted after a trial.
Mr al-Kidd filed the lawsuit against Mr Ashcroft and other officials in 2005.
He said his detention was part of an illegal government policy to arrest and detain people - particularly Muslim men and those of Arab descent - as material witnesses if the government suspected them of a crime but had no evidence to charge them.
Mr Ashcroft had asked the judge to dismiss the matter, saying that he had absolute immunity in his position.
However, the judges said even qualified immunity does not allow the attorney general to carry out national security functions completely free from any personal liability concerns.
Mr al-Kidd's attorney, Lee Gelernt, of the American Civil Liberties Union, said: "Our hope is that we can now begin the process of uncovering the full contours of this illegal national policy."
The judges' ruling said that Mr Ashcroft had said the use of the material witness statute and other tactics "form one part of the department's concentrated strategy to prevent terrorist attacks by taking suspected terrorists off the street".
But the judges also noted that Mr al-Kidd will have a significant burden to show that Mr Ashcroft was personally involved in an illegal policy.