Responding to civil liberties groups who cast the budding technology as dangerously flawed and an invasion of privacy, California lawmakers on Wednesday approved temporarily barring law enforcement from implementing facial recognition software.

The American Civil Liberties Union and other critics of the technology want to keep law enforcement agencies from installing the software on officer body cameras until developers like Amazon and Microsoft can work out the kinks. Along with privacy concerns, the ACLU says the technology has been proven to misidentify minorities and could open them up to wrongful arrests.

The state Senate narrowly cleared the ACLU’s bill by a 22-15 margin, with two Republicans voting for the bill and six Democrats voting against. The bill headed back to the Assembly for a procedural vote, which passed Thursday 42-18. The bill heads to Governor Gavin Newsom, who has 30 days to sign or veto.

“This technology is not ready for primetime,” said Assemblymember Phil Ting, D-San Francisco, the bill’s author. “It’s important to put a pause on this so people are not falsely accused, or even worse, falsely arrested.”

Other Democrats agreed.

“I think it’s appropriate that we have a pause to allow technology to catch up, and to allow our overall thinking and attitudes about community interaction with law enforcement to catch up as well,” said state Sen. Holly Mitchell, D-Los Angeles.

California law enforcement agencies have united against Assembly Bill 1215, painting it as a threat to public safety. They call the ban heavy-handed, particularly in a state known for technological innovation and hosting major events like the Rose Bowl and Coachella Music and Arts Festival.

“By banning this technology, California will be announcing to the nation and world that it doesn’t want our law enforcement officers to have the necessary tools they need to properly protect the public and attendees of these events,” the Riverside Sheriffs’ Association warned in an opposition letter.

Yet skeptics argue there is plenty of evidence showing the technology isn’t ready to be used by officers patrolling California streets.

A recent study conducted by the ACLU used Amazon’s facial recognition software called Rekognition to cross-check 120 California legislators against a database of 25,000 publicly available mug shots. The algorithm falsely identified 26 of the lawmakers – including Ting – leading the ACLU and state Democrats to push for the three-year enforcement ban.

The ACLU also conducted a similar study in 2018 that found Amazon’s product incorrectly matched 28 members of Congress to the mug shots of other people.

In response to the studies, Amazon and industry groups have accused the ACLU of rigging the test by using low confidence thresholds in order to create mismatches.

The Information Technology & Innovation Foundation says if AB 1215 becomes law, the ban would take a useful tool out of law enforcement’s arsenal. The group is urging lawmakers to consider enacting safeguards to monitor law enforcement’s use of facial recognition.

“Instead of banning uses of the technology, policymakers concerned about false matches should require law enforcement use high confidence thresholds to limit false positives to a very low level. Moreover, even when there are false matches in the field—whether caused by a computer or human error—law enforcement officials use multiple methods to verify someone’s identity and they require additional evidence to arrest and prosecute individuals,” the group said in a statement Tuesday.

This summer, one of the country’s largest suppliers of law enforcement cameras and other equipment announced it wouldn’t add the controversial technology to its police body cameras. Arizona-based Axon conducted an independent ethics study which found the technology “not currently reliable enough to ethically justify its use on body-worn cameras.”

Whether the California bill is signed or not, the movement to keep law enforcement from the technology is gaining steam: City councils in San Francisco, Oakland and Somerville, Massachusetts, have voted to ban government use of face surveillance, and the Massachusetts Legislature is considering a similar moratorium.

Ting tried to bring law enforcement around on the bill when he amended the proposal last week to include the three-year sunset provision, but groups like the California Police Chiefs Association and Peace Officers’ Association of California remain opposed. If signed, the Legislature will have to pass another bill to extend the ban past Jan. 1, 2023.