School pupils and college students may have been "guinea pigs" in a police project in which officers "promoted the apparent need for stop-and-search", the Liberal Democrats have claimed.

The party's Scottish justice spokeswoman Alison McInnes raised concerns after officers from Police Scotland spoke to almost 900 children and young people on visits to secondary schools in Fife, colleges in the area and St Andrews University.

The visits were part of a pilot project aimed at improving public confidence in the use of stop-and-search by officers.

A report by academics at Dundee and Edinburgh Napier universities has already suggested police used the visits as opportunities to promote the controversial practice, saying one purpose seemed to be "promoting stop-and-search itself".

Police officers visited 19 high schools, three colleges and St Andrews University, speaking to a total of 879 pupils and students on 54 visits, according to papers released to the Liberal Democrats under freedom of information laws.

These said the "aim of the engagement is to speak with young persons who have been the subject of stop-and-searches and obtain feedback from them" about the practice, adding that "if no persons make themselves known as stop-and-search subjects, engagement should be done and opinions/views on stop-and-search should be obtained".

Officers were told there "is no specific script for this engagement", allowing them to be "natural and positively engage with the young people within these educational institutions".

But Ms McInnes claimed there was "little record" of what took place during the police visits, questioning if officers told youngsters about their right to decline "so-called consensual searches".

She said: "Far from building constructive relationships with young people, it seems that hundreds of young people in Fife risked becoming guinea pigs in an exercise aimed at normalising so-called consensual stop-and-search.

"Officers weren't given a script by their bosses and there is little record of what happened at each of the 54 visits. There is no suggestion that police chiefs were interested in enlightening children about their rights during these sessions and the evidence indicates that the officers tasked with gathering feedback also promoted the apparent need for stop-and-search.

"Were children told of their right to decline so-called consensual searches? Did officers explain that the majority of searches conducted by the police aren't based on any suspicion of wrongdoing?"

Ms McInnes added: "Experts including the Children's Commissioner, Human Rights Commissioner, the UN and dozens of charities have now called for the abolition of so-called consensual searches because they jeopardise civil liberties."

She pledged that when Holyrood returns to business next month she would bring forward proposals "to change the law and abolish intrusive, random and unjustified searches for everyone".

Divisional Commander Chief Superintendent Angela McLaren said: "Fife division embarked upon this pilot initiative to ensure the use of stop-and-search is transparent, meets the expectations of the public, captures good practice whilst informing policy and practice and crucially ensures the use of this tactic is lawful, ethical, proportionate and effective."

She said officers had received "face-to-face training" before the pilot project started, and added: "Police Scotland worked with partner organisations including youth groups to encourage awareness of the pilot and that young people were aware of their rights.

"The face-to-face training also incorporated the new consensual statement that must be read verbatim to potential persons being asked to consent to searches. This information was then part of the engagement with local youths, as well as other groups, to make them more informed. The engagement was also part of our policy of not alienating relationships between police and young people, and was one of the motivators behind the engagement strategy.

"All engagement sessions were recorded and the anecdotal evidence formed part of the Scottish Institute for Policing Research (SIPR) review of the project which went on to inform the recommendations. The SIPR study outlines a number of recommendations from the research, which are informing the development of future policy and practice around stop-and-search across Scotland. It also allowed us to engage our outreach to young people, which all formed part of the outputs from the pilot.

"The use of stop-and-search is one of several legitimate policing tactics used to deliver an effective service in tackling the priorities local communities tell us matter to them. Used in the right place and at the right time, it can play a key role in keeping people safe."