Number 10 was involved in discussions with the Guardian about material it had obtained from American whistle-blower Edward Snowden, it has emerged.

Prime Minister David Cameron ordered Britain’s top civil servant Sir Jeremy Heywood to contact the newspaper.

It came after the Guardian published details about secret US and British surveillance programmes.

Editor Alan Rusbridger said it was later forced to destroy the computer hard drives storing the information.

Mr Rusbridger said his conversations with the government were with “a very senior official claiming to represent the views of the prime minister”.

But he did not say exactly who he had spoken to.

Explicit approval

The Independent and Daily Mail now report that Cabinet Secretary Sir Jeremy made contact with the Guardian.

BBC political correspondent Chris Mason said these reports were accurate.

Whitehall sources emphasised it would have been a “total abdication of their responsibilities” not to talk to the Guardian.

The government feared that if secret data held by the newspaper fell into what it called “the wrong hands” it could have been a threat to the UK.

 The Guardian destroyed the computer containing information leaked by Edward Snowden

The conversations between Whitehall and the Guardian took place with the explicit approval of Mr Cameron, Deputy Prime Minister Nick Clegg and Foreign Secretary William Hague.

Following the conversations, Mr Rusbridger agreed to what he has called one of the most bizarre incidents in the newspaper’s history.

Two GCHQ security experts oversaw the destruction in a basement of computer files containing information from America’s National Security Agency leaked by Mr Snowden.

Mr Rusbridger said: “We were quite clear we were not going to hand this material back to the British government so we destroyed it ourselves under advice from a couple of GCHQ intelligence experts, who told us which bits of the hard drive to smash up, in what way.”

The files had already been copied and the Guardian will continue to pursue the Snowden story, but from the US.

Mr Rusbridger believed handing the hard drives to the government would have been a betrayal of the newspaper’s source.

Alan Rusbridger: “It was made plain that the government was on the verge of launching legal action against the Guardian”

Former National Security Agency contractor Mr Snowden is now based in Russia.

Asked about the Independent’s story, a spokeswoman for the Guardian told the BBC: “We’re not going to comment on this.”

Meanwhile, a Brazilian man held for nine hours at Heathrow airport under anti-terror laws on Sunday has said he was forced to divulge email and social media account passwords.

David Miranda said his interrogators threatened that he could go to prison if he did not do so.

Mr Miranda is the partner of Guardian journalist Glenn Greenwald who has covered stories based on leaks by US whistle-blower Edward Snowden.

Mr Miranda has launched legal action over the use of the powers on him.