Plans to abolish so-called "consensual search" will hinder the investigation of crime, the Scottish Police Federation has claimed.

The body, which represents rank-and-file officers, has always been sceptical about mass use of the tactic driven by what it believes was a target culture under outgoing chief constable Sir Stephen House.

However, its chairman, Brian Docherty, has refused to welcome an announcement from Justice Secretary Michael Matheson that the practice will end and be replaced by more robust English-style statutory searches.

Mr Docherty said: "Consent has led to the detection of serious crimes in the past and its removal will hinder the investigation of crime and the disruption of serious and organised criminality in the future.

"We don't believe any of our communities want that."

Mr Matheson took his decision after an expert group led by defence QC and civil rights expert John Scott came to the conclusion that abolition of consensual searches would have no detrimental effect.

Many consensual searches - sometimes called "stop and searches" in the English manner - recorded during the boom years turned out to be alcohol confiscations, including from children.

Human and civil rights groups had expressed concern that children and other vulnerable people may not have understood that they could refuse to be searched.

Mr Scott said, moreover, that the legality of such a consensual search was in doubt. There has never been a test case.

He added: "If non-statutory stop-and-search is ended, officers of Police Scotland will still be able to carry out their duties effectively.

"Abolition will not result in any significant gaps.

"Specifically, officers will still be able to respond to any welfare or protection issues they encounter.

"Action will still be possible even when required on an emergency basis, whether carried out by police officers, social workers, medical staff or others."

Mr Scott's group, however, was split on what the consequences of abolishing the tactic would be.

He will develop a new code of practice for stop-searches, which will now all be enforced, carried out under suspicion. This will mean new legislation, among other things, to make suspicion that a person is carrying alcohol illegally a grounds for a statutory search.

Mr Matheson, announcing the code of practice in Holyrood, said: "The current system of consensual stop and search will end once that code comes into effect."