The use of mass surveillance programmes by Britain's intelligence agencies is a totally legitimate area for debate, Nick Clegg has said.
The Deputy Prime Minister said some of the "technical secrets" disclosed by the former US intelligence operative Edward Snowden and published in the Guardian would be of "immense interest" to terrorists.
But he said it was right that there should be a public debate about the wider issues regarding the use of surveillance technology by agencies such as GCHQ.
His comments came after the director general of MI5, Andrew Parker, warned that the disclosure of the "reach and limits" of the GCHQ's capabilities was a "gift" to terrorists.
Mr Parker dismissed suggestions that the agencies were trawling through people's private lives for anything that looked interesting as "utter nonsense".
Speaking on his weekly radio phone-in on LBC 97.3, Mr Clegg acknowledged that the disclosures in the Guardian were damaging.
"I have got no doubt that there were some parts of what was published which will have passed most readers of the Guardian completely by, because they were very technical, that would have been of immense interest to people who want harm," he said.
But he said the development by the agencies of powerful new communications surveillance techniques raised wider issues of concern.
"I think there is a totally legitimate debate to be had - and my experience speaking to people in the intelligence agencies is they recognise this - about the use of these new, incredibly powerful technologies," he said.
"We have regulations that were designed for an age which is quite different now. Both terrorists and states and security agencies now conduct this battle online in a way that was unimaginable just a few years ago.
"What that means for privacy and proportionality, that is a totally legitimate area of debate. How you hold the secret parts of any state to account is an incredibly important issue.
"Secrecy is necessary, of course it is. You must absolutely defend the principle of secrecy for the intelligence agencies, without which they can't keep us safe. But you can only really make secrecy legitimate in the eyes of the public if there is proper form of accountability."
Mr Snowden, who is in Russia, leaked information to the Guardian in May that revealed mass surveillance programmes such as the US National Security Agency (NSA)-run Prism and the GCHQ-operated Tempora.
Under the £1 billion Tempora operation, Cheltenham-based GCHQ is understood to have secretly accessed fibre-optic cables carrying huge amounts of internet and communications data and shared the information with the NSA.
David Cameron said newspapers that reveal vast amounts of security information need to think about their responsibilities and whether they are helping to keep the country safe.
Speaking on a visit to York, the Prime Minister said: "I think our intelligence and security services do a very good job of keeping us safe.
"Every year since I've been Prime Minister there has been one or two major plots that could have led to huge loss of life in our country and we rely on the intelligence services to help keep us safe.
"But when you get newspapers who get hold of vast amounts of data and information, which is effectively stolen information, and they think it's OK to reveal this, I think they have to think about their responsibilities and are they helping to keep our country safe."
He went on: "To be fair to the Guardian, when I sent the Cabinet Secretary to tell them about how dangerous it was to hold this information, they agreed to have a whole lot of it destroyed.
"They have understood it on some occasions but they need to show understanding about this issue because it does go to our ability to fight terrorism."