The UK government will enact emergency legislation next week forcing internet and phone companies to log records of calls, text and online activity.
An emergency cabinet meeting will be held in Whitehall on Thursday where prime minister David Cameron and his deputy Nick Clegg will inform the cabinet that emergency legislation is needed in order to keep the country safe.
The legislation will force telecoms companies and internet service providers to retain the data of users for a year, with Cameron saying the move was vital to protect national security following a decision by Europe's top court.
The rushed legislation has come about after a ruling earlier this year in the European Court of Justice which threw out a 2006 EU directive which had required companies to retain data for 12 months.
In April the court declared the Data Retention Directive invalid in response to a case brought by Digital Rights Ireland against the Irish authorities and others. Previously the Advocate General of the court Cruz Villalón said the Directive was incompatible with the Charter of Fundamental Rights.
No new powers
The scrapping of the directive could deprive police and intelligence agencies of access to information about who customers contacted by phone, text or email, and where and when, the British government said.
While Cameron said the legislation was necessary to make sure police forces and intelligence agencies in the UK were not hinders in their investigations, he added that the new legislation would not give intelligence agencies any new powers.
"No government introduces fast track legislation lightly. But the consequences of not acting are grave," Cameron said.
"I want to be very clear that we are not introducing new powers or capabilities – that is not for this Parliament. This is about restoring two vital measures ensuring that our law enforcement and intelligence agencies maintain the right tools to keep us all safe."
The new laws come at a time of heightened tension around the collection and retention of people's data and the monitoring of their online activity.
In the last 12 months revelations from NSA whistleblower Edward Snowden have shown the extent of the powers available and used by the UK government's spying arm GCHQ.
Last year the proposed Communications Data Bill was thrown out after Nick Clegg said it went too far. The Bill, dubbed by its opponents as the Snooper's Charter, proposed to force UK internet service providers (ISPs) to retain the information relating to their customers online activity for up to one year.
The new legislation has already been condemned by Open Rights Group with executive director Jim Killock saying:
"The government knows that since the European Court of Justice ruling, there is no legal basis for making internet service providers retain our data so it is using the threat of terrorism as an excuse for getting this law passed.
"The Government has had since April to address the ruling but it is only now that organisations such as ORG are threatening legal action that this has become an 'emergency'."
The emergency security legislation, which has the support of all three major parties, will include a termination clause meaning it will expire in 2016 meaning lawmakers will have to look at the measures in detail again before then.