SAN FRANCISCO, Sept 12 (Reuters) - California’s legislature on Thursday passed a three-year ban on state and local lawenforcement from using body cameras with facial recognition software, the latest curb on technology that some say poses athreat to civil liberties.

The State Assembly voted 42-18 for the bill, AB-1215, after a vote in favor by the Senate on Wednesday. It will now head to Governor Gavin Newsom’s desk for signing or a veto, and it would take effect on Jan. 1, 2020.

The legislation prohibits officers from running facial recognition in real time or after the fact on footage collectedby body cameras. However, police still may use the technology toblur faces in videos disclosed to the public, in order toprotect individuals’ privacy. Police groups opposed the billwhile others, including the American Civil Liberties Union of Northern California, backed it.

Assemblymember Phil Ting, the bill’s sponsor, said Thursday’s vote was important for maintaining trust in communities that have benefited from the transparency cameras provide.

“If you install software onto those body cameras, then you run the risk of really destroying that trust,” he told reporters. “It becomes a tool of surveillance, which was never the goal.”

The bill reflects growing discontent in the United States over facial recognition, which government agencies have used for years and now has become more powerful with the rise of cloud computing and artificial intelligence technologies. San Francisco and Oakland voted this year to ban city personnel from using it.

Critics have said facial recognition is not ready for primetime, pointing to technology from Amazon.com Inc and others that struggled to identify the gender of individuals with darker skin in recent studies. This has prompted fears of unjust arrests.

Amazon has defended its work and said all users must follow the law.

California is poised to follow states including Oregon that have prohibited facial recognition for officer-worn cameras, which Ting’s bill likens to “requiring every person to show a personal photo identification card at all times.” This “may chill the exercise of free speech in public places,” the bill says.

A revision this month shortened the proposed law’s duration to three years from seven, addressing concerns that the technology might greatly improve. The California Police ChiefsAssociation said on Twitter on Tuesday that the technology is only used to narrow lists of suspects in investigations, not to automate decisions on whom to arrest.

(Reporting by Jeffrey Dastin; Editing by Sandra Maler)