U.K. authorities can continue to examine data seized from David Miranda, the partner of Guardian journalist Glenn Greenwald, who exposed the extent of the U.S.'s surveillance program -- but only if it is in the interest of national security, a judge ruled Thursday.

In what was claimed as a partial victory by lawyers for Miranda -- whose partner has written a series of reports based on leaked documents from former National Security Agency contractor Edward Snowden -- a British court granted a limited injunction in relation to items taken from Miranda at London's Heathrow Airport on Aug. 18.

Under the ruling, the British government and police must cease from "inspecting, copying or sharing" data taken from Miranda during his nine-hour detention on Sunday unless national security issues are at stake.

The court also determined that any information gleaned from items that include a laptop, a phone, two memory sticks, DVDs, a hard drive and a games console could not be used as part of a criminal investigation against Miranda.

The partial injunction will run until Aug. 30.

Miranda's lawyer Gwendolen Morgan argued that it is now up to the government to "prove there is a genuine threat to national security."

"Confidentiality, once lost, can clearly never be restored," Morgan argued at the court hearing. "If interim relief is not granted, then the claimant is likely to suffer irremediable prejudice, as are the other journalistic sources whose confidential information is contained in the material seized."

The attorney representing British police at the hearing, Jonathan Laidlaw, made clear that police had already trawled through tens of thousands of pages of digital material they had seized from Miranda -- and were only partway through it. He insisted the data was of significant concern to national security.

"That which has been inspected contains in the view of the police highly sensitive material, the disclosure of which would be gravely injurious to public safety, and thus the police have now initiated a criminal investigation," he said. "There is an absolutely compelling reason to permit this investigation to continue."

Miranda, 28, was returning from Germany to the home he shares with Greenwald in Brazil when he was detained. In Berlin he had met with Laura Poitras, a U.S. filmmaker who has worked with Greenwald on the NSA story.

The injunction issued in the U.K. case came a day after the NSA declassified three secret court opinions showing how, in one of its surveillance programs over a three-year period, it scooped up as many as 56,000 emails and other communications by Americans not connected to terrorism.

Al Jazeera and wire services

