San Francisco has become the first United States city to ban the use of facial recognition technology by the police and other agencies.
The emerging technology will not be allowed to be used by local agencies, such as the city's transport authority, or law enforcement.
Additionally, any plans to buy any kind of new surveillance technology must now be approved by city administrators.
Opponents of the measure said it will put people's safety at risk and hinder efforts to fight crime.
Those in favour of the move said the technology as it exists today is unreliable, and represented an unnecessary infringement on people's privacy and liberty.
In particular, opponents argued the systems are error prone, particularly when dealing with women or people with darker skin.
"This is really about saying: 'We can have security without being a security state. We can have good policing without being a police state.' And part of that is building trust with the community based on good community information, not on Big Brother technology," said Supervisor Aaron Peskin, who championed the legislation.
Matt Cagle from the American Civil Liberties Union in Northern California, said: "With this vote, San Francisco has declared that face surveillance technology is incompatible with a healthy democracy and that residents deserve a voice in decisions about high-tech surveillance.
"We applaud the city for listening to the community, and leading the way forward with this crucial legislation. Other cities should take note and set up similar safeguards to protect people's safety and civil rights."
The vote was passed by San Francisco's supervisors 8-1, with two absentees. The measure is expected to be officially passed into city law after a second vote next week.
"Instead of an outright ban, we believe a moratorium would have been more appropriate," said Joel Engardio, vice-president of a resident public safety group Stop Crime SF.
"We agree there are problems with facial recognition ID technology and it should not be used today. But the technology will improve and it could be a useful tool for public safety when used responsibly. We should keep the door open for that possibility."
Privacy advocates have squared off with public safety proponents at several heated hearings in San Francisco, a city teeming with tech innovation and the home of Twitter, Airbnb and Uber.
Those who support the ban say the technology is flawed and a serious threat to civil liberties, especially in a city that cherishes public protest and privacy. They worry people will one day not be able to go to a mall, the park or a school without being identified and tracked.
People don't expect privacy in public spaces, critic says
But critics say police need all the help they can get, especially in a city with high-profile events and high rates of property crime. That people expect privacy in public space is unreasonable given the proliferation of cellphones and surveillance cameras, said Meredith Serra, a member of Stop Crime SF.
"To me, the ordinance seems to be a costly additional layer of bureaucracy that really does nothing to improve the safety of our citizens," she said at a hearing.
The new rules will not apply to security measures at San Francisco's airport or sea port, as they are run by federal, not local, agencies.
Some campaigners unsuccessfully urged for the measures not to apply to local police. While San Francisco's officers do not currently use facial recognition technology, a number of other police forces across the US do.
The city of Oakland is considering similar legislation.
- BBC / AP