Plans to make it easier for the police and intelligence agencies to monitor e-mails, phone calls and internet use have been unveiled, but with promises of "strict safeguards".
The Draft Communications Bill would update existing procedures for allowing access to "vital" information.
This includes phone numbers and e-mail addresses but not content of messages.
Civil liberties groups said they were dismayed by the plan, which they described as a "snooper's charter".
The issue has caused friction within the coalition amid criticism from some Lib Dem and Conservative MPs.
The government argues the law needs to keep pace with technological changes and enable the security services to confront changing threats to the UK.
'Lawful and efficient'
The proposed UK-wide legislation, which has been published in draft form, would seek to "maintain the ability" of the authorities "to access vital communications data under strict safeguards to protect the public".
It would update the rules governing how information can be collected and retained by mobile and internet firms in a "lawful and efficient" manner and ensure it "remains available" to the authorities to protect the public.
At the moment basic information can be accessed by police, intelligence agencies or other public bodies without any external authorisation - simply by a senior official within the organisation signing the request off.
But security experts say existing laws date back to 2000 and they are not equipped to cover social media, Skype and other methods of communication.
Ministers are stressing that the police and other bodies will not be allowed to look at the content of e-mails or text messages without a warrant, as is the case now.
Instead, access would be limited - as now - to details of when conversations took place, for how long and where someone was when they made a call. However, the police would be able to see which websites someone had visited.
The government have outlined a number of safeguards which they hope will allay fears about the plans. They include:
- A 12-month limit on how long data can be retained
- Measures to prevent unauthorised access
- Strengthening independent oversight
- Boosting the role of tribunals to consider complaints
But campaign group Liberty said the proposals threatened individual privacy and suggested the coalition had gone back on a pledge on coming to office to end the storage of web and e-mail records "without good reason".
"Two years ago, the coalition bound itself together with promises and action to protect our rights and freedoms," said its director Shami Chakrabarti.
"As the strains of governing in a recession begin to show, politicians of all parties should remember the values we are all supposed to share."
And former shadow home secretary David Davis, a frequent critic of the extension of state powers, said the proposals would be costly to implement and were "very similar" to the last Labour government's plans for a communications database dropped following Tory opposition.
He told MPs it would be "pretty straightforward" for terrorists to avoid scrutiny under the plans by using proxy servers and multiple phones.
"We will create something which will not be effective against terrorism but which will be a general purpose surveillance on the entire nation."
The proposals sparked a row when they were first floated in April, with critics describing them as a "Big Brother" move.
Newspaper reports suggested GCHQ, the government's listening agency, would be authorised to monitor internet traffic in "real time" using so-called "black box" technology.
A spokesman for the Information Commissioner Christopher Graham said the "case for this proposal still has to be made".
"We shall expect to see strong and convincing safeguards and limitations to accompany the bill," he said in a statement.
Prime Minister David Cameron has said any gaps in security must be plugged and it is the government's responsibility to do everything they can to keep the country safe.
And the plans were backed by Conservative MP Bob Stewart who said granting access to such information would be justified if it "saved lives".
And Lib Dem MP Martin Horwood said it should be possible to "strike a perfectly good balance" between protecting traditional freedoms and applying the principles of existing legislation to new technology to "prevent our security services falling behind".