Police Scotland has become the first UK force to release details of how many times it accessed phone records to find journalistic sources.
The force used the Regulation of Investigatory Powers Act to obtain sources’ records on seven occasions in the three years to 6 October 2014.
In addition, the force has made five unlawful applications on sources’ records this year.
In February this year, the Interception of Communications Commissioner’s Office (IOCCO) revealed in a report that 19 police forces had used the RIPA to secretly find journalists’ sources between October 2011 and October 2014.
As part of these applications, 82 journalists had their phone records accessed.
IOCCO has declined to identify the forces concerned and attempts under the Freedom of Information Act to obtain this information from forces have so far been met with blanket refusals.
But Police Scotland has now provided this information to the Scottish Newspaper Society.
Police Scotland’s disclosure comes shortly after IOCCO named it as one of two forces to have used RIPA to find journalistic sources without judicial approval after the law was changed to prevent this in March.
The force initially refused to supply the information to John McLellan, director of the Scottish Newspaper Society, but did so following contact with the Scottish Information Commissioner.
The disclosure, seen by Press Gazette, shows that six of the seven applications were authorised by officers and one was turned down.
Police Scotland did not disclose details of the cases and the SNS is considering whether to seek further information.
McLellan said: "We might never know exactly why Police Scotland found it necessary to trace journalists' sources on so many occasions, but this shows the extent to which they went to investigate matters which were almost certainly more about embarrassment rather than the public interest.
"Only they can explain why valuable resources were repeatedly diverted to track down those whose only crime was to assist journalists in bringing matters of importance to public attention.
"Once the practice became known, we sought more information and to compound the felony Police Scotland then spent over a year blocking what was always a reasonable request. We are therefore grateful for the intervention of the Scottish Information Commissioner to help Police Scotland find a sensible way forward.
"It is to be hoped lessons have been learnt and the new Police leadership can forge a better relationship with the press."
Assistant chief constable Ruaraidh Nicolson said: "In October 2014, Police Scotland responded to a request from the Interception of Communications Commissioner's Office (IOCCO) in respect of identifying the number of investigations where the acquisition of communications data related to journalistic sources.
"Of the seven identified investigations, four predate the formation of Police Scotland on 1 April 2013. Six of these applications were authorised and one refused.
"None of these seven applications concerned a journalist, and the six applications were legally and appropriated authorised under the Regulation of Investigatory Powers Act (RIPA) 2000’ and were later the subject of IOCCO inspection in the usual way.
"Communications data is an important investigative tool. As the public would expect, Police Scotland investigates all allegations of information breaches.
"Police Scotland does not discuss the details of individual applications."
Email pged@pressgazette.co.uk to point out mistakes, provide story tips or send in a letter for publication on our "Letters Page" blog