WASHINGTON - The Supreme Court ruled unanimously Tuesday that former Attorney General John Ashcroft could not be sued for his role in jailing a supposed witness in the antiterror effort.

In a case that united the Bush and Obama administrations, the court concluded that Ashcroft deserved immunity because he had not clearly violated any laws in the jailing of native-born U.S. citizen Abdullah al-Kidd. Federal authorities held Kidd for 16 days in 2003 as a potential witness before releasing him without ever calling him as one.

"Qualified immunity gives government officials breathing room to make reasonable but mistaken judgments about open legal questions," Justice Antonin Scalia wrote for the majority in Ashcroft v. al-Kidd.

The justices ruled 8-0 in support of Ashcroft's immunity, though they divided over broader issues left unresolved.

"Half of the justices who participated in today's decision expressed real questions about how the government used the material witness statute in al-Kidd's case," said American Civil Liberties Union attorney Lee Gelernt, who helped represent Kidd.

Justice Elena Kagan did not participate in the case, having worked on it as President Obama's solicitor general. Kagan's former deputy, acting Solicitor General Neal Katyal, had argued that prosecutors and top officials needed protection from lawsuits.

"Allowing such suits to proceed would result in burdensome litigation and interfere with the ability of prosecutors to do their jobs," he warned at oral arguments in March.

Authorities seized Kidd, who converted to Islam while attending the University of Idaho, as he was boarding a flight in March 2003 for Saudi Arabia, where he planned to study religion and Arabic. Although law enforcement officials didn't charge him with a crime, they maintained that his testimony might be needed in the trial of Sami Omar al Hussayen, a University of Idaho graduate student accused of visa fraud, making false statements, and providing support to terrorists. Hussayen ultimately agreed to be deported after a jury acquitted him on some charges and deadlocked on others.

Kidd, a father of two children, endured severe, high-security conditions described as "brutal" by Justice Ruth Bader Ginsburg. The cell lights were kept on 24 hours a day. He was repeatedly strip-searched and was shackled while being moved from jail to jail.

Even after being let out of jail, he was controlled under supervised release for 14 months. The circumstances led to his losing a job and becoming separated from his wife, the Ninth Circuit appeals court had noted.

Justices John G. Roberts Jr., Clarence Thomas, and Samuel A. Alito Jr. agreed with the entirety of Scalia's opinion. Justices Ginsburg, Anthony M. Kennedy, Stephen G. Breyer, and Sonia Sotomayor agreed Ashcroft was protected from lawsuits, but they filed multiple concurring opinions. In particular, the court's liberal wing noted that the ruling did not address the overall scope of the material-witness statute.

Read the justices' opinions in the Ashcroft case via http://