Legal history was made today after officers from the Metropolitan Police applied to a judge to view two journalists’ phone records.
Previously, such requests would be approved internally and in secret at the police force concerned.
But following the Press Gazette Save Our Sources campaign, UK law was changed in March requiring police forces to obtain the approval of a judge if they wish to view a journalist's phone records.
Politicians of all parties accepted that only a judge could balance the importance of protecting a free press and confidential sources against the public interest in the police investigation.
Friday's application, granted today by a judge, was made by officers from the Met’s Operation Elveden investigation into payments by journalists to public officials.
A lawyer for the Metropolitan Police appeared before Mr Justice Sweeney at the Old Bailey to seek access to information involving two journalists and two public officials, who cannot be named for legal reasons.
One of the named journalists was among those whose cases were dropped last month by the Crown Prosecution Service following a review.
Following lengthy legal argument on Friday, the senior judge today approved the police applications for all three production orders.
Because the Elveden application was the first to fall under the new rules, Mr Justice Sweeney made an "exception" for it to be heard in open court.
He said: "Normally applications would be held in private but given they are the first of their type and following the interception commissioner report on the change of approach to applications of this type … it seemed to me exceptional and subject to submissions it would be appropriate for them to be held in open court."
He added that he was not "intending to set a precedent at all" and in cases where applications could interfere with an ongoing investigation it would be "very surprising" if they were heard in open court.
The application related to the investigation and prosecution over allegations that public officials were paid by tabloid newspapers for tips.
The Met officers wanted access to phone call data, including subscriber information and bill records, which involved serving notice to the phone service provider as well as to the journalists, the court heard.
Jeremy Johnson QC, for the Metropolitan Police, justified breaching the individuals' privacy by saying it was in the "public interest".
He argued there were "reasonable grounds" to believe a crime had been committed and that the information would be of "substantial" value to the investigation.
The application was made only after steps to gain information from other sources were taken, he said.
He added: "The police conceded it involved an interference with the right to respect for correspondence, the right to freedom of expression, and that the interference was particularly acute in the context of communications between a journalist and his or her source but that it was necessary to make."
He asserted that the production orders were "proportionate" in the interests of preventing crime.
Two out of the three applications were opposed by defence lawyers.
Mr Justice Sweeney approved all the applications, although two of the production orders he issued were on more limited terms than those the Metropolitan Police had sought.
Operation Elveden was launched in 2011 following public inquiries and has led to the prosecution of 28 public officials and 27 journalists.
So far it has led to the convictions of 21 officials. But no journalist has yet been convicted by a jury at a trial.
Requests for journalists' call records were previously made under the Regulation of Investigatory Powers Act.
According to the Interception of Communications Commissioner, UK police forces secretly obtained the phone records of 82 journalists over the last three years in order to identify confidential sources.
Under the new legislation, police must use the procedures under the Police and Criminal Evidence Act to obtain journalists' call records – i.e. by making the request through a judge.
The new system has come under fire from media groups because most applications are expected to be made to telecoms providers, without notice to the journalists and news organisations.
Email pged@pressgazette.co.uk to point out mistakes, provide story tips or send in a letter for publication on our "Letters Page" blog