Police Scotland's counter-corruption unit (CCU) operates in a "grey area" between criminality and misconduct with "scant regard for the rules of fairness or proportionality", according to a police rank-and-file association.

The Scottish Police Federation (SPF) said the legal powers of the CCU "are far from clear" and it appears to act "largely with impunity ... outside criminal procedure or misconduct investigation".

HM Inspector of Constabulary in Scotland is reviewing the CCU's compliance with legislation following complaints it has been "illegally spying on journalists".

The Interception of Communications Commissioner's Office (IOCCO) ruled Police Scotland (PSoS) had contravened the Acquisition and Disclosure of Communications Data Code of Practice on five occasions.

SPF said the activities and and conduct of the CCU "have been a source of concern for the SPF for some considerable time" in a submission to Holyrood's Justice Sub-Committee on Policing ahead of its meeting on Thursday.

General secretary Calum Steele said: "It appears to be a department within the Police Service of Scotland that largely acted with impunity and with scant regard for the rules of fairness or proportionality.

"The legal powers of the CCU are far from clear.

"We are aware of members being ordered or invited to interviews which have a status that appears to sit outside criminal procedure or misconduct investigation.

"We consider it could be argued that in some instances officers may, in fact, be considered detained in a form of custody whilst investigations take place.

"Criminality is dealt with by the laws of Scotland; misconduct is dealt with by the conduct regulations.

"Yet when it comes to suspected corruption, the PSoS operates in a significant grey area.

"The SPF does not find this acceptable and officers may have their duties restricted, be moved from one location to another and denied career development or promotion without ever knowing the reasons why or the identity of their accuser (if any).

"It is unclear to the SPF where the remit of the CCU stops and the remit of the professional standards department begin.

"For example, the recent meeting of the Scottish Police Authority was advised that the CCU would be ensuring mandatory training in data protection, a matter we would consider should squarely sit with the professional standards department."

Police Scotland has said it would be inappropriate to comment ahead of Thursday's committee meeting.