The House of Lords has passed the Investigatory Powers Bill meaning that is likely to be in force in a matter of weeks.
The Bill has already been passed by the House of Commons and codifies a system under which the state can deploy a variety of electronic snooping tactics to fight crime, including widespread collection of electronic data.
Internet and phone companies will be required to store comprehensive records for 12 months and enable law enforcement bodies to access those records on demand.
It also allows police and other bodies to hack into and bug computers and smartphones with the approval of the home secretary.
It replaces the Regulation of Investigatory Powers Act, which police forces across the UK made widespread use of to collect information about journalists and their sources.
RIPA was most notoriously used to find and punish police officers who gave information to The Sun about the Plebgate affair of September 2012.
It was used to find out who called Sun journalists and when and also to track their movements using GPS data.
The new law builds on changes to RIPA which were passed by Parliament in March 2015 after the Press Gazette Save Our Sources campaign.
These provided that police requests to view journalists’ call records in order to identify their sources had to be signed off by judges.
After pressure from media organisations, additional protections have been included in the IP Bill to protect journalistic sources.
But the changes do not go as far as groups like the NUJ, Press Gaette and the News Media Association had hoped.
Unlike the Police and Criminal Evidence Act (which covers physical journalistic material), news organisations will not be able to argue the case in court against the release of digital material.
Requests to view their call data will be made in secret to telecoms providers and will need approval from a “judicial commissioner”.
Such approvals will only be made when there is an “overriding public interest”.
The Lords yesterday agreed to withdraw an amendment to the bill which sought to impose legal costs penalties in phone-hacking cases on publishers who are not part of a Royal Charter-backed press regulator.
The Government is currently carrying out a ten-week consultation on whether to enforce, repeal or amend Section 40 of the Crime and Courts Act 2013. This is the law which has been passed, but not commenced, which says news publishers who aren’t signed up to a Royal Charter-backed press regulator must pay both sides’ costs even if they win libel and privacy cases.
Although the Section 40 clause has been withdrawn from this bill, the Lords said they would return to this issue.
Lord Lipsey said: “If anyone thinks there is no problem now with the press post-IPSO, they should read the coverage of what has happened to poor Prince Harry and his girlfriend.
“With the privacy issues involved in that, do they really feel that this shows—although there are, no doubt, two sides to the case—that the press has put its badnesses from the past behind it? I submit that they should not. This is a matter that requires urgent treatment—although I agree, not in the Bill.”
Lord Paddick said: “I am sure it will not be long before this House has another opportunity to vote to force the Government to implement the provisions of the Crime and Courts Act 2013 that protect innocent victims from unreasonable and unnecessary press intrusion. The Government should know that we on these Benches will support such a vote.”
Email pged@pressgazette.co.uk to point out mistakes, provide story tips or send in a letter for publication on our "Letters Page" blog