The UK just passed the most elaborate mass surveillance law in the Western world. The Investigatory Powers Bill, commonly referred to in England as “The Snoopers Charter,” gives the government unprecedented access to the online activities of its citizens as well as legally requiring tech companies to cooperate with government investigations.

Both the House of Lords and the House of Commons have now passed the bill, leaving only the final step, royal assent or approval from the queen, in order to go into effect. It is expected to receive that formal blessing before the end of the year.

The intent behind the bill is to allow the British government the authority to prevent the internet from being used to commit crimes, though many privacy groups and tech companies argue that it infringes upon the privacy of law-abiding citizens.

The bill will require ISPs (internet service providers) to retain records of all online activities for a year, and permits various government agencies access to these records for law enforcement purposes. It also gives the government the legal right to hack into computers and mobile devices. The method, referred to as “equipment interference,” can include extracting information, monitoring the use of or listening in on any communications transmitted over computers, mobile phones, or other digitally connected devices.