Authorisation from a judge will in future be required before police can access journalists' phone records to identify their sources, the Government has said.
Home Secretary Theresa May said that she accepted "in full" the recommendations of an official review which found the existing Regulation of Investigatory Powers Act (Ripa) did not "provide adequate safeguards to protect journalistic sources".
In his report, the Interception of Communications Commissioner Sir Anthony May concluded: "It is recommended that judicial authorisation is obtained in cases where communications data is sought to determine the source of journalistic information."
The review of the use of the Ripa surveillance powers was launched in October after alarm was expressed about incidents such as Scotland Yard accessing the phone records of Sun reporter Tom Newton Dunn to find who had leaked information on the Plebgate row.
In a statement welcoming the findings, Mrs May said: "Communications data is a critical tool used by police and other agencies to investigate crime, safeguard national security and protect the public, and safeguards exist to ensure powers are not abused.
"However a free press is fundamental to a free society and the Government is determined that nothing is done that puts that at risk."
In a letter to Mrs May, Deputy Prime Minister Nick Clegg urged her to bring forward legislation before the end of the month.
"We have an opportunity to act on this recommendation at report stage of the Serious Crime Bill in the Commons on February 23. I hope that you will look urgently at drafting Government amendments to that effect," the Liberal Democrat leader wrote
In his report, Sir Anthony found that over a three-year period 19 police forces had sought communications data in relation to 34 investigations into illicit dealings between public officials and journalists.
Some 608 applications for such data were authorised, by a ranking officer. But the report stressed that was just 0.1% of the total applications authorised by police under the legislation.
It also concluded that police had not used Ripa to circumvent other legislation and forces were not "randomly trawling communications data relating to journalists in order to identify their sources".
"Generally speaking, the police forces did not give the question of necessity, proportionality and collateral intrusion sufficient consideration," the report said.
"They focused on privacy considerations (Article 8 of the European Convention on Human Rights) and did not give due consideration to freedom of speech (Article 10).
"The current Home Office Code of Practice (and the recently revised draft Code said to provide protection for sensitive professions) do not provide adequate safeguards to protect journalistic sources or prevent unnecessary or disproportionate intrusions."