A police force has been ordered to pay £10,000 in damages to one of its former officers after a tribunal ruled the force had acted unlawfully when it obtained communications data.
An Investigatory Powers Tribunal (IPT) concluded Police Scotland's actions were contrary to the Human Rights Act of 1998.
Two former police officers and their wives, together with two serving policemen, took the action against the force to "complain of the collateral interference with their privacy".
It comes after Sir Stanley Burton, the Interception of Communications Commissioner, ruled in November 2015 that Police Scotland contravened the acquisition and disclosure of communications data code of practice on five occasions.
The Interception of Communications Commissioner's Office (IOCCO) conducted a review after fears were raised officers had been ''illegally spying on journalists'', with these incidents linked to the investigation into the murder of prostitute Emma Caldwell in 2005.
Gerard Gallacher, a former police officer who carried out an 18-month journalistic investigation into the case, is to be paid £10,000 after telling the tribunal he had suffered an "invasion of privacy, familial strife, personal stress and strain and loss of long-standing friendships" as a result of Police Scotland's actions.
The IPT ruled the interference with his rights to freedom of expression were "serious in respect of the obtaining of more than 32 days of communications data".
Of the six complainants, only Mr Gallacher and his wife had been seeking compensation.
The tribunal also ordered that an inquiry into the breach of guidelines by police be conducted by a senior officer "from another police force in the United Kingdom other than Scotland, and without any previous relevant connection with Police Scotland".
At the end of July, Phil Gormley, the Chief Constable of Police Scotland, asked Mike Barton, Chief Constable of Durham Constabulary, to head an independent investigation into the issue.
Detective Inspector David Moran, one of the complainants in the case, welcomed "the judgement of the IPT in connection with their examination of Police Scotland's unlawful actions in trying to ascertain the sources of a journalist" after a newspaper published an article which was critical of the Emma Caldwell murder investigation.
Mr Moran said: "That there is to be an inquiry by an external police force into the circumstances surrounding the affair is a large step forward, however I have concerns that Police Scotland have invited the Chief Constable of Durham Constabulary to examine the outstanding 'non-criminal' matters only.
"I do not believe that is in the spirit of what was discussed at the IPT hearing on July 22 and that all matters, whether potentially criminal or non-criminal, should be on the agenda for a new independent and impartial enquiry.
"Nobody, including myself, knows the full detail of what happened, the level it reached within Police Scotland and who exactly caused officers to break the laws and codes governing the interception of communications.
"Until that is fully established then, in my opinion, no assumption should be made that criminality was not involved."
Last year, Mr Moran contacted MSPs on Holyrood's Justice Committee, saying he had been falsely identified as the source for the newspaper article and this has left his reputation ''severely scarred''.
He said the tribunal judgement stated Police Scotland had "no intelligence" suggesting he was involved in leaking information.
With regard to the Emma Caldwell murder, Mr Moran said: "I had no knowledge of that enquiry, no access to any documentation relating to it and no motivation whatsoever to involve myself in leaking details of a ten-year-old murder inquiry."
He added: "At this point, I am seeking only a public declaration by Police Scotland that will be clear in expressing there was no wrongdoing on my part.
"I don't believe that is unreasonable in the circumstances and that there is no need to await the result of the enquiry by Durham Constabulary for that to happen."
David Kennedy, deputy general secretary of the Scottish Police Federation, said: "This judgement leaves no doubt that the actions of the Police Service of Scotland towards our members (and others) breached their human rights.
"The SPF had no hesitation in supporting our members seek remedy for this breach and we sincerely hope the service will reflect on this ruling when considering their future actions."
Police Scotland Deputy Chief Constable Iain Livingstone said the force would "consider and act" on the findings of the IPT.
He stated: "Last month Chief Constable Phil Gormley asked Chief Constable Mike Barton, of Durham Constabulary, to conduct an independent investigation into a number of non-criminal complaints, which relate to matters connected to the breach of communications data protocols and guidance.
"The Interception of Communications Commissioner's Office found that Police Scotland breached guidelines around approval processes for communications data applications in 2015.
"Police Scotland has fully accepted that standards fell below those required in this case. It would be inappropriate to comment further at this stage given the investigation to be conducted by Chief Constable Barton.
"Following the breach, a full review was immediately conducted to ensure there could be no repeat of the circumstances which led to the IOCCO determination, which Police Scotland accepted.
"HMICS has also conducted a review of counter-corruption and work is ongoing to address the recommendations made following its inspection."