The country's interior minister, Home Secretary Theresa May, vowed its intrusive reach would be governed by "the strongest safeguards" against abuse. Opening a House of Commons debate on the contentious bill, May said the law would provide "unparalleled openness and transparency" about the authorities' surveillance powers.
The Investigatory Powers Bill gives law enforcement officials broad powers to obtain Internet connection records - a list of websites, apps and messaging services someone has visited, though not the individual pages they looked at or the messages they sent. It also requires telecommunications companies to keep records of customers' Web histories for up to a year and to help security services gain access to suspects' electronic devices.
The bill also makes official - and legal, with some restraints - the intelligence agencies' existing ability to harvest vast amounts of bulk online data. The existence of the secretive collection schemes was exposed by US National Security Agency leaker Edward Snowden.
May said that criminals and terrorists are exploiting technology to the hilt, and "we must ensure that those charged with keeping us safe are able to keep pace."
May wants the bill to become law by year's end. But it is strongly opposed by civil liberties groups, who say it grants spy agencies powers that are far too sweeping.
In a letter published Tuesday in the Guardian newspaper, more than 200 senior lawyers and law professors said the bill "compromises the essence of the fundamental right to privacy and may be illegal." They said it would likely be subject to lengthy and expensive legal challenges.
Internet companies including Facebook, Google, Apple, Microsoft, Twitter and Yahoo have also raised concerns, saying the measures could weaken encryption, which is key to ensuring online shopping and other activities can be conducted securely.
The Internet Service Providers' Association said its members found the bill complicated and difficult to understand and believed its estimates of what it would cost to implement were "entirely unrealistic."
Despite the criticism, the bill passed its first parliamentary vote 281-15, and will go to a committee for scrutiny. The opposition Labour Party and Scottish National Party abstained, saying the legislation should be amended before becoming law.