A Court of Session judge has been appointed Scotland’s new “surveillance tsar” in the wake of police spying revelations.
Lord Bracadale has been made surveillance commissioner in Scotland.
It emerged last year that Scottish police had spied on their own officers in order to identify the source of media leaks.
Opposition parties at Holyrood warned that the new post must guarantee freedom of the press.
The Liberal Democrat MSP Liam McArthur said: “The fact that a commissioner is now in place will mean nothing unless he vigorously protects the interests of journalists and others who have had their communications data intercepted unlawfully.
“Units within Police Scotland played fast and loose with the rules to identify journalistic sources and in many respects seem to have ignored them altogether.
“This cannot be allowed to happen again. A free press is vital to our democracy.”
The single force’s counter corruption unit breached the Acquisition and Disclosure of Communications Data Code of Practice by failing to seek judicial approval before spying on its own to determine who was leaking information about the murder of sex worker Emma Caldwell.
A report of the UK’s Office of the Surveillance Commissioners for 2015-16, published this month referred to the issue.
It stated: “We are concerned that one police force in the United Kingdom finds itself in a different position to its counterparts across the border.”
A Scottish government spokeswoman said: “Surveillance Commissioners are people who have held high judicial office which provides strong assurance of independence and integrity in carrying out their functions.
“The Interception of Communications Commissioner has commented on the robust and rigorous steps Police Scotland has now taken to ensure processes for all communications data applications are fully compliant with the Code of Practice and all legislative requirements.”