By BBC News

The government will be able to monitor the calls, emails, texts and website visits of everyone in the UK under new legislation set to be announced soon.

Internet firms will be required to give intelligence agency GCHQ access to communications on demand, in real time.

The Home Office says the move is key to tackling crime and terrorism, but civil liberties groups have criticised it.

Tory MP David Davis called it “an unnecessary extension of the ability of the state to snoop on ordinary people”.

Attempts by the last Labour government to take similar steps failed after huge opposition, including from the Tories.

‘Unprecedented step’

A new law – which may be announced in the forthcoming Queen’s Speech in May – would not allow GCHQ to access the content of emails, calls or messages without a warrant.

But it would enable intelligence officers to identify who an individual or group is in contact with, how often and for how long. They would also be able to see which websites someone had visited.

In a statement, the Home Office said action was needed to “maintain the continued availability of communications data as technology changes”.

David Davis Conservative MP and former shadow home secretary

“It is vital that police and security services are able to obtain communications data in certain circumstances to investigate serious crime and terrorism and to protect the public,” a spokesman said.

“As set out in the Strategic Defence and Security Review we will legislate as soon as parliamentary time allows to ensure that the use of communications data is compatible with the government’s approach to civil liberties.”

But Conservative MP and former shadow home secretary David Davis said it would make it easier for the government “to eavesdrop on vast numbers of people”.

“What this is talking about doing is not focusing on terrorists or criminals, it’s absolutely everybody’s emails, phone calls, web access…” he told the BBC.

Read more from BBC News: http://www.bbc.co.uk/news/uk-politics-17576745