Britain's intelligence services have officially been given the "most extreme spying powers ever seen".
The Investigatory Powers Act has now been given royal assent, meaning that those surveillance rules will pass into law. The bill was officially unveiled a year ago and passed through the House of Lords earlier this month, but the act of being signed off means that those powers now go into effect.
It adds new surveillance powers including rules that force internet providers to keep completely records of every website that all of their customers visit. Those will be available to a wide range of agencies, which includes the Department for Work and Pensions as well as the Food Standards Agency.
As well as those internet connection records, surveillance agencies will also be given new powers to force companies to help hack into phones, and to collect more information than ever before on anyone in Britain.
The Home Office hailed the new law as a "landmark Bill which sets ot and governs the poewrs available to the police, security and intelligence agencies to gather and access electronic communications". It said in a statement that it "brings together and updates existing powers while radically overhauling how they are authorised and overseen".
Not all of the powers available in the Bill will be rolled out straight away. Some require testing so will not be ready for some time, the Home Office said.
But others replace the Data Retention and Investigatory Powers Act 2014, also known as Dripa, which is set to expire on 31 December and so urgently needed updating with the new bill.
Home Secretary Amber Rudd said: "This Government is clear that, at a time of heightened security threat, it is essential our law enforcement, security and intelligence services have the powers they need to keep people safe.
"The internet presents new opportunities for terrorists and we must ensure we have the capabilities to confront this challenge. But it is also right that these powers are subject to strict safeguards and rigorous oversight.
"The Investigatory Powers Act is world-leading legislation that provides unprecedented transparency and substantial privacy protection."
The Bill has been opposed by tens of thousands of people in a petition. But that is thought to have begun too late and so is likely not to lead to any change in the law.