The Court of Appeal has upheld an unprecedented gagging order preventing the media reporting why a terrorism suspect was cleared at trial.
London student Erol Incedal was found not guilty in March last year of preparing for acts of terrorism.
Senior judges said it was right that the full details of the Old Bailey case remained secret.
The BBC and other media organisations challenged the reporting restrictions imposed by the trial judge.
Only 10 of the almost 70 hours of evidence were heard in open court.
Specially accredited journalists were allowed to hear some of the secret evidence in locked sessions, but they were banned from telling others what they had seen or heard, and their notebooks were retained by the court.
More than a third of the prosecution case was held in complete secrecy with the jury told they could face jail if they ever revealed what they had heard.
In their ruling, Lord Chief Justice Lord Thomas and two other senior judges said there was a strong public interest in allowing reports about counter-terrorism police and the security services provided it does not "materially compromise the effectiveness of their role or otherwise might damage national security".
They added that "departure from the principles of open justice was strictly necessary" in this case but accepted another application may be made in future "at a time when it is said that there could no longer be any reason to keep the information from the public".
By Jeremy Britton, BBC News
As one of only 10 journalists who were allowed to sit in on the two "secret trials" of Erol Incedal, I learned a great deal.
But as I was barred from repeating a word of what was said behind those closed doors, it was a dubious privilege.
For the journalists having to place our mobile phones in a metal case every time we entered court, and having to hand over our notebooks to be locked up in a safe at the end of every day, it was both time consuming and embarrassing.
Most frustrating was that the public were able to be told so little about the defendant's responses to the serious allegations.
This lack of balance troubled me, but I was banned by order of the court from discussing the defendant's case with anyone.
I fear the reasons for his acquittal on the main charge of preparing for acts of terrorism will remain a secret of the state and all my notes will remain locked up - or even be destroyed.
Incedal, who is in his mid-20s, faced two trials in relation to allegations he was involved in some form of terrorism that appeared to be related to Syria.
At the end of the first trial in 2014, he was convicted of possessing bomb-making plans and was later jailed for 42 months for that offence.
But the jury could not reach a verdict on an allegation he was involved in actual preparations for terrorism. He was cleared at the second trial.
During the small amount of evidence heard in open court, prosecutors alleged Incedal had been in contact with a British jihadist in Syria, held the details of an address linked to Tony and Cherie Blair and discussed - in code - gun attacks.
Prosecutors said a "person of significance" could have been the target of an alleged plan - but at no point did they explicitly link that in open court to the Blairs.