David Miranda, the partner of a journalist at the heart of the Edward Snowden NSA surveillance firestorm, handed over to British intelligence the crypto passwords for digital files they seized from him when he stopped over in the UK en route from a meeting with a US film-maker who was also involved with the Snowden disclosures. It has also emerged that the US government was aware that the British intelligence services intended to target Miranda during his journey.

"There was a heads up that was provided by the British government," said Josh Earnest, the principal deputy White House press secretary, at a press conference

"This is something we had an indication that was likely to occur," he said, "but it's not something that we requested, it was something that was done by British law enforcement officials. The United States was not involved in that decision or in that action."

Earnest didn't say if the US had received copies of the information taken from Miranda during his questioning, and when asked to rule out any receipt, Earnest replied, "I'm not in a position to do that right now."

Miranda is the partner of Glenn Greenwald, the Guardian journalist who has been instrumental in revealing information on highly secret, massive internet surveillance by the United States' NSA and Britain's GCHQ electronic-intelligence agencies. Miranda was stopped and interrogated by British police during a stopover at Heathrow airport while flying from Germany back to his and Greenwald's home in Brazil at the Guardian's expense. He had travelled to Germany to meet with Laura Poitras, an American film-maker also involved in the Snowden leaks.

The Brazilian government has torn a strip off the UK government over the interrogation, calling the detention of one of its citizens "without justification" in a statement, and saying it does not want a repeat of the incident.

The detention has caused a political storm in the UK, with British MP Tom Watson saying it was a clear attempt at intimidation and an attack on journalism. The Prime Minister's office has declined to answer questions on the detention, saying it was an "operational matter" for the police.

David Anderson, the UK's independent reviewer of terrorism legislation, said that the case was "unusual," since of the 60,000 to 70,000 people stopped under Schedule 7 each year, only 40 have been held for more than six hours. Anderson also said that he had requested a ministerial briefing on the case. British police say that the detention of Miranda was "legally and procedurally sound."

Glenn Greenwald and David Miranda (right) reunited in Rio

In his first interview since arriving safely in Brazil, Miranda said that he was forced to hand over the passwords for his laptop and mobile phone after British police officers threatened him with prison if he refused. Also taken were an external hard drive, two memory sticks, a games console, and two newly-bought watches and phones which were still in their packaging.

"They were threatening me all the time and saying I would be put in jail if I didn't co-operate," said Miranda. "They treated me like I was a criminal or someone about to attack the UK ... It was exhausting and frustrating, but I knew I wasn't doing anything wrong."

Miranda said that as soon as his plane landed at Heathrow, passengers were asked to display their passports, and that the second he stepped off the aircraft he was detained by four officers. He was then held for nine hours, the maximum allowed under Schedule 7 of the 2000 Terrorism Act.

Despite this, Miranda said he wasn't asked about terrorism by his British interrogators. Instead, he was extensively quizzed about his visit to Berlin-based filmmaker Laura Poitras, the activities of his partner Glenn Greenwald, and if there were plans to publish more papers from the NSA whistleblower Edward Snowden.

"They even asked me about the protests in Brazil, why people were unhappy, and who I knew in the government," said Miranda.

After nine hours of questioning, Miranda was informed that he was free to leave for a connecting flight to his home in Brazil. Since he'd missed his connection, and another flight wasn't scheduled for a while, the police released him onto British soil.

"It was ridiculous," he said. "First they treat me like a terrorist suspect. Then they are ready to release me in the UK." ®