San Francisco supervisors on Tuesday voted to ban the use of facial recognition software by police and other city departments, becoming the first US city to outlaw a rapidly developing technology that has alarmed privacy and civil liberties advocates. The ban is part of broader legislation that requires city departments to establish use policies and obtain board approval for surveillance technology they want to purchase or are using at present.

Government agencies across the US have used the technology for more than a decade to scan databases for suspects and prevent identity fraud.

However, recent advances in artificial intelligence have created more sophisticated computer vision tools, making it easier for police to pinpoint a missing child or protester in a moving crowd, or for retailers to analyze shoppers’ facial expressions as they peruse store shelves.

Efforts to restrict its use are getting pushback from law enforcement groups and the tech industry, although it is far from a united front. Microsoft, while opposed to an outright ban, has urged lawmakers to set limits on the technology, warning that leaving it unchecked could enable an oppressive dystopia reminiscent of George Orwell’s novel 1984.

“Face recognition is one of those technologies that people get how creepy it is,” said Alvaro Bedoya, who directs Georgetown University’s Center on Privacy and Technology. “It’s not like cookies on a browser. There’s something about this technology that really sets the hairs on the back of people’s heads up.”

Without regulations barring law enforcement from accessing driver’s license databases, people who have never been arrested could be part of virtual police lineups without their knowledge, skeptics of the technology say.

They worry people will one day not be able to go to a park, store or school without being identified and tracked.

Already, a handful of big box stores across the US are trying out cameras with facial recognition that can guess their customers’ age, gender or mood as they walk by, with the goal of showing them targeted, real-time ads on in-store video screens.

After San Francisco adopted a ban, other cities, states or even the US Congress could follow, with lawmakers from across party lines looking to curtail government surveillance and others hoping to restrict how businesses analyze the faces, emotions and gaits of an unsuspecting public.

The California Legislature is considering a proposal prohibiting the use of facial ID technology on body cameras. A bipartisan bill in the US Senate would exempt police applications, but set limits on businesses analyzing people’s faces without their consent.

Legislation similar to San Francisco’s is pending in Oakland, California, and on Thursday last week, another proposed ban was introduced in Somerville, Massachusetts.

Bedoya said a ban in San Francisco, the “most technologically advanced city in our country,” would send a warning to other police departments thinking of trying out the imperfect technology.

However, Daniel Castro, vice president of the industry-backed Information Technology and Innovation Foundation, said that the ordinance is too extreme to serve as a model.

“It might find success in San Francisco, but I will be surprised if it finds success in a lot of other cities,” he said.

San Francisco is home to tech innovators such as Uber, Airbnb and Twitter, but the city’s relationship with the industry is testy. Some supervisors at San Francisco City Hall are calling for a tax on stock-based compensation in response to a wave of companies going public, including Lyft and Pinterest.