The Hi gh Court rules today on whether a journalist's partner held for nine hours at Heathrow under anti-terror laws was, or was not, unlawfully detained.
Brazilian David Miranda lives with Guardian writer Glenn Greenwald, who exposed secret information on US surveillance leaked by whistle-blower Edward Snowden.
On Sunday August 18 last year Mr Miranda, 28, was in transit from Germany to Brazil when he was stopped at the airport, detained, questioned and searched by police under Schedule 7 of the Terrorism Act 2000.
Mr Miranda had nine items, including his laptop, mobile phone, memory cards and DVDs, taken from him while detained.
His lawyers challenged the legality of the use of counter-terrorism powers at a two-day hearing in London before Lord Justice Laws, Mr Justice Ouseley and Mr Justice Openshaw. Today the judges give their ruling.
A coalition of 10 media and free speech organisations intervened in the case to express their concerns about the use of anti-terror powers against journalists.
Matthew Ryder QC, for Mr Miranda, told the judges: "This claim is about the use of counter-terrorism powers, that can only be used at ports and airports, to seize journalistic material."
He argued that, in Mr Miranda's case, the powers were exercised improperly.
The "dominant purpose" of the examining officers was not to determine whether he was a person involved in the commission, instigation or preparation of acts of terrorism, but to "assist the Security Service in accessing material in the claimant's possession".
It was also a "disproportionate interference with his right to freedom of expression".
Mr Ryder said the background to the legal action taken by Mr Miranda concerned material obtained by former US National Security Agency (NSA) contractor Mr Snowden.
Articles based on some of the Snowden material had been published by the Guardian and other highly-respected news publications, and one of the leading figures in writing those articles was Mr Greenwald.
The QC said articles based on the material "have resulted in global interest" at the highest level and had started an international debate.
He told the court that at the relevant time Mr Greenwald was working for the Guardian and Mr Miranda was "assisting Mr Greenwald's journalistic work".
High Court judges have already ruled that the material seized from him could only be examined for national security purposes and the protection of the public, and no other.
The judicial review action is being contested by the Home Secretary and the Metropolitan Police.
Mr Ryder said: "The exceptional nature of this case insofar as it involves the use of Schedule 7 powers to obtain highly controversial journalistic material, should not be underestimated."
The use of the power to take journalistic material from Mr Miranda "appears to be unprecedented".
The QC argued that use of Schedule 7 measures against him was "not proportionate and in breach of his right to freedom of expression".
Steven Kovats QC emphasised on behalf of the Home Secretary that "disclosure of all the material stolen by Mr Snowden would be gravely damaging to the national security of the United Kingdom" and that "such disclosure would endanger lives".
The Home Secretary "pursuant to her duty to protect national security, had a duty to act against that risk".
Mr Kovats argued that her national security duty to establish the nature of Mr Miranda's activity was "consistent" with use by the police of Schedule 7.
If publication of material obtained by Mr Snowden was capable of being an act of terrorism - and the Home Secretary "submits that it is" - then "seeking to establish the nature of the claimant's activity" was both meeting the Home Secretary's national security duty and discharging the police's Schedule 7 function "of seeking to determine whether the claimant was or appeared to be a person who was or had been concerned in the commission, preparation or instigation of acts of terrorism".