London (CNN) -- David Miranda, the partner of Guardian journalist Glenn Greenwald, won a partial victory in his legal action against the Metropolitan Police Thursday, but the judge left a loophole that allows the police to continue investigating the materials they seized from him on Sunday.
Miranda, a Brazilian citizen, spent nearly nine hours in detention Sunday being questioned under a provision of Britain's terrorism laws, after he was stopped as he changed planes on his way home from Berlin to Brazil.
Authorities confiscated Miranda's electronic equipment, including his mobile phone, laptop, memory sticks, smart watch, DVDs and games consoles.
The High Court order says that the inspection, copying, disclosure, transfer and distribution of the materials seized must cease, save for the purpose of protecting national security and for the purpose of investigating whether the claimant is a person who is, or has been, connected with terrorism.
The Metropolitan Police said it is pleased that the High Court "rejected an attempt to prevent further examination" of the seized material.
"We welcome the decision of the court which allows our examination of the material -- containing thousands of classified intelligence documents -- to continue in order to protect life and national security," police said.
Jonathan Laidlaw, a lawyer representing the Metropolitan Police, told the court a criminal investigation has been launched following inspection of the material seized from Miranda.
"Initial examination of material seized has identified highly sensitive material, the disclosure of which could put lives at risk," police said. "As a result the Counter Terrorism Command ... has today begun a criminal investigation. This investigation is at an early stage and we are not prepared to discuss it in any further detail at this stage."
Speaking outside court, Miranda's lawyer Gwendolen Morgan, of the law firm Bindmans, described the ruling as a partial victory.
She said she was not aware of any basis for the criminal investigation, adding that at no point during his detention was Miranda asked any questions about whether he was a terrorist.
Miranda and his legal team will decide whether to appeal the ruling after the court provides its full reasoning, she said.
The implications of this judgment are "something journalists worldwide should be worried about," Morgan added.
Miranda's partner, Greenwald, has been at the forefront of high-profile reports exposing secrets in U.S. intelligence programs, based on leaks from former U.S. National Security Agency contractor Edward Snowden.
'Misuse' of terror law
Bindmans, which was hired by The Guardian to represent Miranda, filed the case to seek recovery of Miranda's property and prevent the government from inspecting the items or sharing what data it may have already gleaned from them.
The High Court claim followed a written request to the Home Office and Metropolitan Police asking for assurances that the material will not be inspected, copied or shared with third parties.
The UK authorities misused Section 7 of the Terrorism Act 2000 to detain Miranda, Morgan said in the court filing Wednesday. Their action was also in breach of European human rights law, she said.
The law firm was seeking an injunction against the government because it has not given the undertakings asked for, she said.
"The purpose of these proceedings is to protect the confidentiality of the sensitive journalistic material that was seized from the Claimant. Confidentiality, once lost, can clearly never be restored," she said.
The British government has defended its actions in Miranda's case, saying it has a duty to ensure national security.
The Metropolitan Police have called what happened "legally and procedurally sound" and said it came after "a detailed decision-making process."
Evidence of pressure from prime minister
New evidence emerged Wednesday that the pressure placed on The Guardian over its reporting on information leaked by Snowden came from the highest levels of government.
Guardian editor Alan Rusbridger told CNN on Wednesday how a senior British official who asked The Guardian to destroy hard drives containing leaked information about the NSA was "acting on behalf of the prime minister," David Cameron.
Rusbridger said the official has now been identified as Cabinet Secretary Jeremy Heywood, and that he first contacted him in mid-June.
"He said he was acting on behalf of the prime minster," Rusbridger said. "For about a period of a month, it was a cordial conversation."
But by mid-July, Rusbridger said, "it became an explicit threat of legal action if we didn't either return the disks or destroy them." The Guardian complied by destroying the hard drives.
"The point, which I explained to the British officials, was that Glenn Greenwald, the Guardian reporter, lives in Brazil," Rusbridger told CNN's Hala Gorani, who was sitting in for Christiane Amanpour. "He has a copy, and we already have another copy in America. So destroying a copy in London wasn't going to stop us from reporting."
Deputy Prime Minister Nick Clegg, who heads the Liberal Democrats, Cameron's coalition partners, considered the authorities' request "reasonable," his office said.
"The Deputy Prime Minister felt this was a preferable approach to taking legal action," according to a statement issued Wednesday evening. "He was keen to protect the Guardian's freedom to publish, whilst taking the necessary steps to safeguard security."
Miranda was stopped as he was returning to the couple's Rio de Janeiro home after staying in Berlin with filmmaker Laura Poitras, who has been working with Greenwald on NSA-related stories.
Miranda has said he doesn't know what material he was carrying. He doesn't work for The Guardian, but the newspaper paid for his flights because he was helping his partner.
He and Greenwald told CNN's Anderson Cooper of their distress and anger about his treatment at Heathrow Airport.
"To start detaining people who they think they are reporting on what they're doing under terrorism laws, that is as dangerous and oppressive as it gets," said Greenwald.
Opinion: U.K. government and press collide in bullying of reporter's partner
CNN's Laura Smith-Spark wrote and Mick Krever and Andrew Carey reported in London. CNN's Bryony Jones and Stephanie Halasz contributed to this report.