IMAGES of hundreds of thousands of Scots are contained on a controversial facial recognition database that is being used by the national police force, raising fresh fears over civil liberties.

Officers have admitted to using the special technology, which attempts to identity faces captured on CCTV and other images, on more than 400 occasions.

In addition, Police Scotland said it has uploaded hundreds of thousands of mugshots onto a UK-wide police database used as a the main resource for facial recognition searches.

Details of Police Scotland's use of the technology were revealed in response to a Freedom of Information request.

The force confirmed mugshots of people charged with an offence were routinely added to the UK-wide Police National Database but stressed the photos were removed if the suspect was not convicted.

It also defended the practise of trawling the vast store of pictures, insisting some searches had solved crimes.

Scots Lib Dem justice spokeswoman Alison McInnes, who uncovered the figures, said it raised concerns about the protection of civil liberties.

She warned: "Without adequate safeguards, there is nothing to stop the police using from using this technology for mass surveillance."

The National Police Database, which contains 18 million mugshots, has already proved controversial.

Independent watchdog Alastair MacGregor, the UK's Biometrics Commissioner, has warned it may include hundreds of thousands of images of innocent people, raising questions about privacy.

MPs on the Commons science and technology committee said they were "alarmed" to learn facial recognition technology could be used on pictures of innocent people.

The database has continued to grow despite a High Court ruling in England which called on some forces to revise their procedures.

When the scale of the database was made public earlier this year, Police Scotland confirmed it was uploading its own custody pictures but declined to say how many. At the time, it did not say it was using facial recognition technology to trawl the database.

But in response to Ms McInnes, it confirmed it has uploaded 601,837 custody mugshots onto the database, featuring 334,594 individuals.

Police Scotland also revealed it had used facial recognition technology in an attempt to match CCTV images with those on the database on 440 occasions.

Ms McInnes said the figures were "staggering" and showed Police Scotland was using "intrusive software" extensively.

She added: "The photos of over 300,000 Scots are among 18 million included in the national database.

"The combination of this database with the new facial recognition software has triggered concerns about the protection of our civil liberties.

"It could be used to identify protestors at political events or football fans, stifling freedom of speech.

"I also have real concerns that the privacy of innocent people could be compromised and they could be exposed to the risk of false identification."

She called on the Scottish Government to guarantee the technology was properly regulated and used appropriately.

Police Scotland said the technology was helping to tackle crime.

In one case, a thief was traced and convicted after a CCTV image of him stealing from a Durham bookmaker's shop was matched with a mugshot uploaded to the national database by Police Scotland.

In another, a man was arrested after a robbery in a Glasgow bookies earlier this year.

Under the force's "retention and weeding" procedures, custody mugshots are added to the database when a suspect is charged.

They are removed when proceedings are dropped or the suspect is found not guilty in court.

Detective Chief Inspector Russell Penman, of Police Scotland's Specialist Crime Division, said: "Police Scotland has been using facial searching functionality on the Police National Database since 2014.

"Facial search is an intelligence tool that can be used for intelligence development purposes.

"It is not used for formal photographic identification procedures, although it does provide intelligence around the suspected identity of an individual whose image has been taken and searched."