A US court has dismissed a lawsuit brought by a German citizen who says he was kidnapped and beaten by the CIA.
Mr Masri was seeking damages and an apology
Khaled el-Masri aimed to sue former CIA chief George Tenet and other officials for their alleged role in the "extraordinary rendition" programme.
Mr el-Masri says he was picked up in Macedonia in 2003 and flown to Kabul, Afghanistan, where he alleges torture.
The judge did not rule on the truth of the allegations, but said letting the case proceed might endanger security.
Rights group the American Civil Liberties Union brought the case on behalf of Mr el-Masri - who was never charged with any terrorist offences.
Besides Mr Tenet, the case named 10 other CIA employees, as well as three other companies and their employees.
However, the district court judge in Virginia rejected the challenge, saying Mr el-Masri's "private interests must give way to the national interest in preserving state secrets".
Lebanese-born Mr el-Masri had demanded compensation and an apology from Mr Tenet and several other CIA figures.
He has alleged he was beaten and injected with drugs after being seized near Macedonia's border with Albania, before being taken to Afghanistan and held for five months.
In his ruling, Judge TS Ellis stressed that by rejecting Mr el-Masri's lawsuit he made no judgement on the strength or otherwise of his allegations.
"[The result reached here] is in no way an adjudication of, or comment on, the merit or lack of merit of Mr el-Masri's complaint," he said.
"Further, it is also important that nothing in this ruling should be taken as a sign of judicial approval or disapproval of rendition programmes.
"In times of war, our country, chiefly through the executive branch, must often take exceptional steps to thwart the enemy."
His case has attracted the attention of German Chancellor Angela Merkel, who raised the issue with US Secretary of State Condoleezza Rice.
Ms Rice has admitted that the US has used so-called "extraordinary rendition" - or secret flights - to move suspects across international borders.
But the US has refused to discuss individual cases and insists it does not condone torture.