The head of Amazon.com's cloud computing division said the company would work with any government agency that followed the law.

This is in contrast with rival Microsoft, which has touted its rejection of controversial sales.

"We will serve the federal government, and they will have to use the technology responsibly," Andy Jassy, CEO of Amazon Web Services, said at the 2019 Code Conference.

He made his comments after being asked if the company worked with US Immigration and Customs Enforcement. 

"Any government department that's following the law, we will serve them," he said, 

However, Jassy said he hopes that the federal regulators "hurry up", adding that "otherwise, you'll have 50 different laws in 50 different states.

In the past year, Amazon has found itself at the centre of a growing debate over the use of facial recognition by governments, with critics warning of false matches and arrests and proponents arguing it keeps the public safe.

Jassy acknowledged that the issue around facial recognition technology was a "real one", but said "just because technology could be misused, doesn't mean you should ban or condemn it."

Law enforcement in Oregon and Florida have used Amazon's face and image ID service, known as Rekognition.

Amazon's approach has differed somewhat from Microsoft's.

While the Windows creator had defended a recent $480m hardware contract to supply the US Army, it held off from selling facial recognition when it believed human rights would be at risk.

Microsoft President Brad Smith said earlier this year that the company had rejected a California law enforcement agency's request to install the technology in officers' body cameras and cars, fearing that would lead to innocent women and minorities being disproportionately held for questioning.

Artificial intelligence tools are often trained largely on images of white men.