Media playback is unsupported on your device Media caption Watch Richard Watson's full report

Newsnight has learnt that highly sophisticated face recognition technology is being tested for use in surveillance operations in the UK.

The technology was used both before and after the Manchester bombings in May.

Face recognition is used at airports for security, but this is believed to be the first use for surveillance of potential terrorist suspects in the UK.

The technology uses artificial intelligence and machine learning.

It is unclear precisely how it was deployed, or if it was a trial. But Newsnight understands that cameras linked to a computer system were used to scan faces for known suspects on a watch list.

After the Manchester suicide bombing in May, the Security Service MI5 let it be known that 23,000 people in the UK have been assessed to have links to violent Islamist extremism. Some 3,000 are in the top tier - judged to be a current threat. Another 20,000 have had recent links in the past.

The former Chief Constable of the British Transport Police Andy Trotter told Newsnight "It's absolutely impossible to use conventional means against that. That number of people - it can't be done."

'We've got to be vigilant'

One source told the programme that UK security agencies are testing new technologies designed to automatically search for people on a watch list of suspects.

"The dreadful events of the last few weeks, those should stick in our minds forever," Mr Trotter told Newsnight.

"They should not fade away… we've got to be vigilant all the time and mustn't let our guard down. We must use the latest technology to take that fight to the terrorists."

Image caption Richard Watson tested the face recognition technology for his Newsnight report

But some rights groups are concerned about the use of the technology in this way.

"This power is being used in secret. We haven't had a conversation as a society about how it should be used," said the director of Liberty, Martha Spurrier.

"What we need is to have that conversation and we need to interrogate whether we are willing for something that can be very invasive, that can have a real impact of innocent people's freedoms everyday."

A security source told Newsnight that systematic face recognition is not currently being used by official agencies in the UK.

However, the source said that the intelligence community is very interested in using new technology to help manage the terror threat.

The source stressed any deployment of new technology would be approved by the government and governed by law.

Richard Watson was reporting for BBC Newsnight