A UK court has ruled the detention of David Miranda, partner of journalist Glenn Greenwald, for nine hours at Heathrow Airport was "a proportionate measure in the circumstances."
Miranda was detained while carrying top-secret documents which had been leaked by Edward Snowden and which were given to Miranda by Laura Poitras to pass on to Greenwald.
In today's ruling Lord Justice John Laws, sitting with Mr Justice Duncan Ouseley and Mr Justice Peter Openshaw, said: "Its objective was not only legitimate, but very pressing" though they admitted it was "an indirect interference with press freedom."
This ruling will be seen as a litmus test for how far governments such as the UK are allowed to go in terms of treating journalists who expose top-secret policies as criminals.
Miranda has said this is not the end of the road, telling The Intercept website:
"I will appeal this ruling, and keep appealing until the end, not because I care about what the British government calls me, but because the values of press freedom that are at stake are too important to do anything but fight until the end."
Greenwald added that the UK is the only country in the world to define him and Poitras as terrorists as a result of their reporting on the Snowden leaks:
"The journalism Laura and I have done with the Guardian and other major news organisations has spawned international debate and reform, and has been honoured with top journalism awards all over the world, but it is only in the UK where our journalism is considered not just criminal but 'terrorism'," he said in a statement to The Intercept, where is a founding member.
Miranda, a Brazilian national, was detained by British police last August as he passed through the transit lounge of Heathrow airport on his way from meeting Poitras in Berlin to his home in Rio, which he shared with Greenwald.
Arrested under the 200o Terrorism Act, Miranda was held for nine hours - the maximum time the law permits without charge or arrest - and questioned on data he was carrying on his laptop, mobile phone and memory sticks, all of which were confiscated and may be kept for up to seven days.
David Miranda brought a legal challenge against the UK police after it seized his property and the high court granted him a limited injunction to prevent the police "inspecting, copying or sharing" the data stored on the property.
The police were however allowed to examine the data for national security purposes or if they are investigating whether or not Miranda is himself involved in the commission, instigation or preparation of an act of terrorism.
Following analysis of the data found on Miranda's property the Met launched a criminal investigation, claiming they found tens of thousands of classified UK intelligence documents.
According to documents published during the court proceedings, the police in the UK determined that Miranda was subject to the 2000 Terrorism Act as he was "likely to be involved in espionage activity" and was "knowingly carrying material, the release of which would endanger people's lives" and was promoting a "political or ideological cause."