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

FILE PHOTO: Police officers separate demonstators during an America First rally in Laguna Beach, California, U.S., August 20, 2017.REUTERS/Sandy Huffaker

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 collected by body cameras. However, police still may use the technology to blur faces in videos disclosed to the public, in order to protect individuals’ privacy. Police groups opposed the bill while 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 prime time, 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 Chiefs Association 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.