Judges have ruled that Cleveland police acted unlawfully when they monitored journalists’ phones in an attempt to uncover the source of a series of leaks.

The police force used powers under the Regulation of Investigatory Powers Act (Ripa) to seize records of calls totalling more than 1m minutes from three journalists, a solicitor and two police officers after details of internal grievances appeared in the Northern Echo in 2012.

Having initially maintained that the data collection was justified, this month the force apologised for its actions after hearing evidence given to an investigatory powers tribunal late last year.

The judgment handed down by the tribunal on Tuesday morning says there was “no lawful basis” for accessing the records and that the amount of data obtained from the targets’ phones was excessive.

Ripa can be used to check data from phones and other devices to discover evidence of crimes where there is a reasonable chance of prosecution. The tribunal judges decided the decision to access the records was based on a “subjective belief” and that targeting the journalists and a solicitor was always unlikely to be justified.

The application for phone data was made in part to uncover the identity of a whistleblower who passed the Northern Echo an internal report that had uncovered elements of institutional racism in the force. The paper ran the story on its front page in 2012.

Tuesday’s judgment says police should have considered that their actions were an infringement of the right to freedom of speech when they accessed data from the personal and work phones of reporters at the paper.

Cleveland’s chief constable, Iain Spittal, who joined the force after the phones were targeted, said: “Although I have already contacted the people affected by this and said sorry, sorry on its own isn’t enough. Because of this the police and crime commissioner and I announced earlier this year an expert review of the professional standards department and all Ripa use over the past six years.

“I am proud to lead Cleveland police. I am confident that those who work with me will continue to strive to be the best that they can be each and every day. When we get things wrong, as we did here, we will say sorry and work to make things right.”

The judgment has been sent to the Independent Police Complaints Commission and the chief inspector of constabulary, Sir Thomas Winsor, for their consideration.

Andy Richardson, the editor of the Northern Echo, told the journalism trade website Hold the Front Page that he was delighted to see the law come down on the side of reporters who were trying to expose matters of public interest “rather than police officers who were attempting to stifle the truth”.

He said: “This is a victory for the free press. I hope it reminds the public that having strong local newspapers is a vital part of the democratic process. We need your continued support. I also hope it reminds newspaper owners how important it is for them to give editors sufficient resources to undertake major, long-running investigations.

“Like many local papers, the Northern Echo has a proud tradition of exposing wrongdoing and corruption. Life would be so much easier for police forces, politicians and dodgy businessmen if investigative reporting simply withered and died. We cannot allow that to happen. This case shows that having teams of experienced reporters unearthing stories in their local communities is a valuable in 2017 as it was in 1870 when the Echo was founded.”