An activist has lost the world's first legal challenge over police's use of facial recognition technology at a High Court in London.

His lawyers argued the use of automatic facial recognition (AFR) by South Wales Police caused him "distress" and violated his privacy and data protection rights by processing an image taken of him in public.

But his case was dismissed on Wednesday by two leading judges, who said the use of the technology was not unlawful.

Ed Bridges believes his face was scanned as he was Christmas shopping and protesting at an arms fair.

Lord Justice Haddon-Cave, sitting with Mr Justice Swift, said: "We are satisfied both that the current legal regime is adequate to ensure appropriate and non-arbitrary use of AFR Locate, and that South Wales Police's use to date of AFR Locate has been consistent with the requirements of the Human Rights Act and the data protection legislation.

The judges said they were told by lawyers during a three-day hearing in May that Mr Bridges' case was the first time any court in the world had considered the use of AFR.

At the start of the ruling, Lord Justice Haddon-Cave said: "The algorithms of the law must keep pace with new and emerging technologies.

"The central issue is whether the current legal regime in the United Kingdom is adequate to ensure the appropriate and non-arbitrary use of AFR in a free and civilised society.

"At the heart of this case lies a dispute about the privacy and data protection implications of AFR.

"Counsel inform us that this is the first time that any court in the world had considered AFR."

The decision was relayed over video link from the High Court in London to the High Court in Cardiff, where the case was heard.

Mr Bridges crowdfunded his legal action against the force and was represented by civil rights campaign group Liberty.

Facial recognition technology maps faces in a crowd by measuring the distance between features then compares results with a "watch list" of images - which can include suspects, missing people and persons of interest.

South Wales Police has been conducting a trial of the technology since 2017, with a view to it being rolled out nationally, and is considered the national lead force on its use.

The trial comprises two pilot projects, AFR Locate and AFR Identify, and the force has used the technology 50 times to date.

South Wales Police Chief Constable Matt Jukes said: "This is innovative work that has put South Wales Police at the front of the development of this technology and the debate that surrounds it.

We have always wrapped some good, common-sense decision-making by experienced police officers around the systems.

Chief Constable Matt Jukes, South Wales Police

In response to the court's ruling, human rights organisation Liberty says they will appeal the decision.

This disappointing judgment does not reflect the very serious threat that facial recognition poses to our rights and freedoms. Facial recognition is a highly intrusive surveillance technology that allows the police to monitor and track us all. It is time that the Government recognised the danger this dystopian technology presents to our democratic values and banned its use. Facial recognition has no place on our streets.

Megan Goulding, Liberty lawyer