* Police says material could pose potential threat to public
* Court lets Britain sift through documents from Miranda
* Britain pulled into global dispute over media freedom (Recasts with investigation, adds comment and detail)
By Costas Pitas
LONDON, Aug 22 (Reuters) - Britain has begun a criminal inquiry after seizing potentially dangerous documents from the partner of a journalist who has led coverage of Edward Snowden's leaks about U.S. and British electronic spying, a lawyer for the police said on Thursday.
The investigation is the latest twist in a surveillance scandal that has pitted U.S. President Barack Obama against the Kremlin and prompted British Prime Minister David Cameron's advisers to demand the return of secrets from the Guardian newspaper.
Using anti-terrorism powers, British police detained David Miranda, partner of American journalist Glenn Greenwald, for nine hours at London's Heathrow Airport on Sunday.
Miranda, a Brazilian citizen who had been ferrying documents between Greenwald and a Berlin-based journalist contact of Snowden's, was released without charge minus his laptop, phone, a computer hard drive and memory sticks.
At a hearing in London's High Court over Miranda's lawyers attempt to prevent British authorities from looking at the tens of thousands of documents on the devices, a lawyer for London's Metropolitan Police said some contained dangerous information.
"That which has been inspected contains, in view of police, highly sensitive material the disclosure of which would be gravely injurious to public safety and thus the police have initiated a criminal investigation," Jonathan Laidlaw said.
The police declined immediate comment on what the criminal investigation was about. Miranda's lawyer, Gwendolen Morgan, told reporters that she knew very little about the investigation or what the basis for it was. Laidlaw refused further comment.
Greenwald, who is based in Brazil and writes for Britain's Guardian, has published articles based on documents leaked by Snowden, the former U.S. National Security Agency contractor who faces criminal charges in the United States.
British security officials say the Snowden leaks, which showed the scale of U.S. and British eavesdropping on everything from phone calls and emails to internet and social media use, have undermined national security and could put lives at risk.
But the detention of Miranda and British government pressure on the Guardian have dragged Cameron into an international row over media freedom and the powers of the security services.
Germany has criticised Britain while Russia, which has granted Snowden temporary asylum, accused the British government of double standards over press freedom.
The Brazilian government, which has complained about the "unjustified" detention of Miranda, asked Britain to return the electronic equipment seized from him.
It was unclear what documents Miranda was carrying or what secrets could have forced Britain to act in such a way. Greenwald has vowed that Britain would come to regret its actions which he said were an attempt to intimidate him.
Two High Court judges, Jack Beatson and Kenneth Parker, ruled that the British authorities could continue to look at the information from Miranda for the defence of national security and to investigate any possible links to terrorism.
Morgan, Miranda's lawyer, said the ruling was a partial victory but they might seek to appeal the decision. The judges gave British authorities until Aug. 30 to sift through the documents.
Miranda's lawyer has also started legal action to ask judges to rule that his detention was illegal. (Writing by Guy Faulconbridge and Michael Holden; Editing by Kate Holton and Pravin Char)