The Oakland City Council voted unanimously Tuesday to ban the use of facial recognition by city departments, including police, making it the third city in the country to do so after San Francisco and Somerville, Mass.

The ordinance, introduced by council president Rebecca Kaplan, amends the city’s current surveillance ordinance and prevent city departments from adopting any facial recognition technology and from using information obtained by the software.

“I am thrilled my colleagues clearly understood the flaws in face recognition technology at this time,” Kaplan said in a statement. “I welcome emerging technologies that improve our lives and facilitate city governance, but when multiple studies show a technology is flawed, biased, and is having unprecedented, chilling effects to our freedom of speech and religion, we have to take stand.”

A study released in January 2018 by the M.I.T. Media Lab found that facial recognition software incorrectly identified up to 35% of darker-skinned women. In 2016, Georgetown University estimated that 117 million Americans were in law enforcement facial recognition databases. The study found police facial recognition technology disproportionately affects African Americans.

“It is important to build trust and good relationships between community and police and to remedy racial bias, however this flawed technology could make those problems worse,” Kaplan said. “The right to privacy and the right to equal protection are fundamental and we cannot surrender them.”

The council’s vote was applauded by Brian Hofer, the chair of the city’s Privacy Advisory Commission, and other supporters.

“I really believe facial recognition is the most dangerous technology developed in my lifetime,” Hofer said. “With cameras already everywhere, the infrastructure is there. This would have been perfect mass surveillance and we would lose the right to be anonymous in public, to freely associate.”

In May, Hofer drafted a proposal that would encourage the Council to ban the use of the software. That proposal was approved by the Privacy Advisory Commission.

“Decisions about whether we want to hand the government the power to identify who attends protests, political rallies, church, or AA meetings should not be made in the secret backroom of a police station, lobbied by corporate executives that market this technology,” said Matt Cagle, technology and civil liberties attorney with the ACLU of Northern California. “These decisions should be made as Somerville, San Francisco, and now Oakland just made: by the public, including the communities that will be most impacted, through an affirmative vote by their elected representatives.”

Oakland has one of the strongest surveillance ordinances in the country. Passed in 2018, it requires that any proposal involving the use of surveillance be heard in a public discussion. City departments are required to produce annual reports on their surveillance technology.

Correction: A previous version of this story misstated the number of cities to ban facial recognition technology before Oakland.

Sarah Ravani is a San Francisco Chronicle staff writer. Email: sravani@sfchronicle.com Twitter: @SarRavani