Intelligence officials reportedly smashed hard drives in the basement of the Guardian headquarters, threatening the paper with legal action over the Edward Snowden intelligence leaks, and telling the paper's editor: "You've had your fun, now we want the stuff back."

The revelations about the "shadowy" conduct of intelligence officials comes as Scotland Yard emphasised detention of the partner of a Guardian journalist at the centre of revelations about US and British security services was "legally and procedurally sound" - and denied allegations he was not given access to a lawyer.

But the detention of David Miranda, partner of Glenn Greenwald, has reignited firece debate over UK terror law, specifically Schedule 7 of the Terrorism Act 2000.

rusbridger

Guardian editor Alan Rusbridger

In an editorial, Alan Rusbridger detailed how GCHQ officials smashed up hard drives in the Guardian's offices, and vowed the paper would never report on surveillance issues from the UK again, basing reporters abroad.

Rusbridger said the communictions were "steely, if cordial, but there was an implicit threat that others within government and Whitehall favoured a far more draconian approach."

But the government officials began insisting the story had run its course, calling Rusbridger to say: "You've had your fun. Now we want the stuff back."

Rusbridger also reported that Whitehall figures were perturbed the Guardian wanted to continue probing the issue, with one telling him: "You've had your debate. There's no need to write any more."

The officials apparently told Rusbridger they were prepared to go to court to force the surrender of the material.

The editor then described two GCHQ experts supervising the destruction of the hard drives in the Guardian's basement "just to make sure there was nothing in the mangled bits of metal which could possibly be of any interest to passing Chinese agents."

Rusbridger said he no longer trusted electronic communications with his journalists based abroad.

"The Guardian's work on the Snowden story has involved many individuals taking a huge number of flights in order to have face-to-face meetings. Not good for the environment, but increasingly the only way to operate," he said.

Greenwald has vowed that the move to detain his partner will only "embolden" him to publish more revelations about the extent of British and American surveillance.

Scotland Yard said in a statement issued last night: "The examination of a 28-year-old man under Schedule 7 of the Terrorism Act 2000 at Heathrow Airport on Sunday 18 August was subject to a detailed decision making process.

"The procedure was reviewed throughout to ensure the examination was both necessary and proportionate.
"Our assessment is that the use of the power in this case was legally and procedurally sound.

"Contrary to some reports the man was offered legal representation while under examination and a solicitor attended. No complaint has been received by the Metropolitan Police Service at this time."

White House spokesman Josh Earnest said the British government gave the United States advance notice that London police intended to detain Miranda but added that the US did not request the detention and was not involved in the decision.

Labour called for an urgent investigation into the use of the powers to question Miranda after he said agents took his "computer, video game, mobile phone, my memory card. Everything".

Miranda was stopped at 8.30am on Sunday when returning from a trip to Berlin. He was questioned under schedule 7 of the Terrorism Act 2000 which applies only at airports, ports and border areas, allowing officers to stop, search, question and detain individuals.

Bob Satchwell, executive director of the Society of Editors, said in a statement: "Journalism may be embarrassing and annoying for governments but it is not terrorism. It is difficult to know how in this instance the law was being used to prevent terrorism.

"On the face of it, it is difficult to avoid the conclusion that the detention of a journalist's partner is anything other than an attempt to intimidate a journalist and his news organisation that is simply informing the public of what is being done by authorities in their name.

"It is another example of a dangerous tendency that the initial reaction of authorities is to assume that journalists are bad when, in fact, they play an important part in any democracy."

Index on Censorship's chief executive Kirsty Hughes said in a statement: "Using the threat of legal action to force a newspaper into destroying material is a direct attack on press freedom in the UK.

"It is unclear which laws would have been used to force the Guardian to hand over its material but it is clear that the Snowden and NSA story is strongly in the public interest.

"Coming on the back of the detention of David Miranda, it seems that the UK government is using, and quite likely misusing, laws to intimidate journalists and silence its critics."

During his trip to Berlin, Miranda visited Laura Poitras, a US film-maker who has been working on the Snowden files with Greenwald and the Guardian.

Rusbridger said the Guardian paid for Miranda's flights, but he was not a Guardian employee.