The detention of Glenn Greenwald’s Brazilian-born partner at Heathrow airport earlier this week drew a heated response from the British journalist and a sharp retort from officials in London.

Greenwald, a reporter for the Guardian newspaper who has written about the National Security Agency’s surveillance programs based on files he received NSA leaker Edward Snowden, sent out an angry piece on his newspaper website that claimed the detention of his partner, David Miranda, will have an opposite effect than the one intended by British officials.

“If the UK and U.S. governments believe that tactics like this are going to deter or intimidate us in any way from continuing to report aggressively on what these documents reveal, they are beyond deluded,” Greenwald wrote in the Guardian. “If anything, it will have only the opposite effect: to embolden us even further.”

A lawyer said Miranda had begun legal action against the government, calling his detention unlawful and seeking assurances that British officials would not share data seized from him with anyone else.

Police used a contentious anti-terrorism law to detain Miranda on Sunday. Miranda was held for nearly nine hours — the maximum allowed by law — and had electronic equipment confiscated.

Miranda, a 28-year-old university student, was traveling home to Brazil after visiting Germany, where he met with Laura Poitras, a U.S. filmmaker who has worked with Greenwald on the NSA stories. Greenwald said Miranda was carrying materials between the two, but didn't specify what they were.

Miranda told the Guardian that agents questioning him "were threatening me all the time and saying I would be put in jail if I didn't cooperate."

Miranda said he was seized almost as soon as his plane landed at Heathrow. "There was an announcement on the plane that everyone had to show their passports. The minute I stepped out of the plane they took me away," he said.

The Guardian and civil liberties groups have condemned the use of counter-terrorism legislation to detain a journalist's partner, but the British Home Office has defended the stance taken.

"The government and the police have a duty to protect the public and our national security," the Home Office said in a statement. "If the police believe that an individual is in possession of highly sensitive stolen information that would help terrorism, then they should act and the law provides them with a framework to do that.”

London law firm Bindmans said it was representing Miranda and had written to police and the government seeking assurances that there would be no "inspection, copying, disclosure, transfer, distribution or interference, in any way, with our client's data pending determination of our client's claim."

"We are most concerned about the unlawful way in which these powers were used and the chilling effect this will have on freedom of expression," said Bindmans lawyer Kate Goold.

The government has claimed the decision to stop Miranda was made by police, although White House spokesman Josh Earnest said Monday that Britain had tipped off the U.S. government that Miranda would be detained.

Prime Minister David Cameron's office said Tuesday that his office had been "kept abreast of the operation," but was not involved in the decision to stop Miranda.

Britain's opposition Labour Party demanded to know whether the government was aware of the operation in advance

"The home secretary needs to tell us whether she or the prime minister were informed or involved in this decision," said Labour law-and-order spokeswoman Yvette Cooper. "Is it really possible that the American president was told what was happening but the British prime minister wasn't?"

The Home Office said it could not "comment on the specifics" of an ongoing police inquiry.

The piece of legislation used to stop Miranda — Schedule 7 of the Terrorism Act — is especially contentious because it allows police to stop people passing through airports without suspicion they have committed an offense. It allows people to be held for up to nine hours, although the vast majority of stops last an hour or less.

After pressure from civil libertarians, the government is in the process of reducing the time limit to six hours and imposing other safeguards, but critics say the measure remains too broad and is open to abuse.

The Metropolitan Police said the use of Schedule 7 to stop Miranda "was legally and procedurally sound."

Guardian editor Alan Rusbridger characterized the detention of Miranda as part of a campaign of official intimidation against the newspaper since it began publishing stories based on Snowden's leaks in June. The articles revealed details of surveillance of electronic communications carried out by U.S. and British spies.

Rusbridger said senior government officials had demanded the return or destruction of Snowden's material, eventually threatening legal action if the newspaper did not comply.

Rusbridger told the BBC Tuesday that it became clear that "the government was on the verge of launching legal action against the Guardian."

He said that faced with that threat, he agreed to destroy hard drives containing Snowden's material at The Guardian's London offices, while staffers from British eavesdropping agency GCHQ watched.

Rusbridger said The Guardian had other copies of the material that was destroyed.

Kirsty Hughes, chief executive of Index on Censorship, said that "using the threat of legal action to force a newspaper into destroying material is a direct attack on press freedom in the U.K."

The Associated Press contributed to this report.

Follow us on twitter.com/foxnewslatino
Like us at facebook.com/foxnewslatino