Guo Bing, a law professor in the Chinese city of Hangzhou, liked the zoo enough to purchase an annual pass. But he didn’t like it nearly enough to let the zoo take a high-resolution scan of his face.

In what judges called the first case of its kind in China, Guo sued the zoo — and won. He argued there was no legal basis for the Hangzhou Safari Park to collect visitors’ biometric data, and that it had not taken precautions to protect the information. In April, a Chinese appeals court ruled in favor of Guo, ordering the zoo to refund him and delete his face scan and fingerprints.

Now, China is putting its freewheeling facial recognition industry on notice. Citing Guo’s case, China’s top court announced this week that consumers’ privacy must be protected from unwarranted face tracking.

“The public is increasingly worried about the abuse of facial recognition technology,” Yang Wanming, vice president of the Supreme People’s Court, said in a news conference on Wednesday. “The calls for strengthening protection of facial information are increasing.”

The court called its edict a joint stance with Beijing’s top government bodies, including the Politburo, Ministry of Public Security, tech ministry and market regulators.

It’s a surprising about-face for a country that has gained notoriety as the most closely surveilled place on Earth. For years, facial recognition cameras sprang up in malls, residential complexes and office buildings, even in public bathrooms to prevent toilet paper theft. Local authorities lauded the initiatives as a high-tech way to fight crime. Individuals’ complaints about privacy invasion were all but ignored.

But Beijing has become alarmed at the growing power of Big Tech — including the risk that personal information of senior officials could leak overseas — and has moved this year to rein in China’s Internet giants. This included derailing the IPO plans of mobile payment titan Ant Group, launching a probe into Didi Chuxing, the Chinese equivalent of Uber, and a ban on the country’s lucrative online, for-profit tutoring services for students.

The crackdown has echoes of the anti-corruption campaign that President Xi Jinping began in 2012, which also neutralized some powerful executives who might challenge Beijing, while appealing to the working class by taking on corporate interests. Back then, the target was state-owned conglomerates, China’s traditional powerhouses. This time, it’s the growing Internet sector.

Other governments around the world are also debating how to use and regulate facial recognition technologies, including in the United States. The state of Virginia ended one controversial police facial recognition system this month, while Microsoft and Amazon have banned sales of their facial recognition software to police until there is more regulation in place. (Amazon founder Jeff Bezos owns The Washington Post.)

In China, face-identification cameras are not only used by police, but have been proudly displayed in commercial settings for years.

The new guidelines from China’s Supreme People’s Court go into effect Aug. 1 and apply to civil cases involving facial recognition technology. The rules say that hotels, shopping malls, airports and other commercial venues must get consent from customers to use facial recognition. The use of the technology cannot exceed what is necessary, and companies must take measures to protect the data.

While the guidelines are vague on what counts as necessary use, the threat of financial penalties from lawsuits is likely to curb some excesses. The document also provides a framework for customers to sue if they feel their privacy has been violated.

China’s facial recognition technology suppliers include some of its largest tech companies, like Huawei and Alibaba. Start-ups have also sprung up to fill the sector, such as Megvii and SenseTime. Some of the vendors have data-sharing agreements with local police or other Chinese authorities, but how the data is stored and used is generally obscure to consumers.

Marshall Meyer, an emeritus professor of management at the University of Pennsylvania who specializes in China policy, said the new restrictions don’t mean China’s residents will no longer be surveilled, only that the use of the technology will be more centralized.

“It is the government, and only the government, that has the right to collect and collate unlimited facial recognition data,” he said. “For consumers, then, there is a little more privacy. But not a lot more.”

Xi has shifted to a “politics in command” approach that accepts some hits to economic growth in exchange for a stronger grip on tech companies, Dexter Roberts, a senior fellow at the Atlantic Council’s Asia Security Initiative, wrote in a report published Thursday.

“Beijing is intent on strengthening control over private companies and foreign investment,” he wrote.

In Guo’s case, the law professor received a text message from the Hangzhou Safari Park on Oct. 17, 2019, saying the park had upgraded from fingerprint recognition to facial recognition for its annual passes, with entry no longer allowed without a registered face scan, according to the court verdict.

The case was delayed several months in the pandemic. Late last year, a first court sided with Guo in a narrow decision, ordering the park to delete his face scan and reimburse him about $160. He appealed, saying he hoped for a broader ruling.

“If it’s only a verdict to delete [my personal data], it’s basically a waste of paper,” he said in a speech in April, according to Chinese publication Sixth Tone.

The second ruling in April was also in Guo’s favor, but remained narrow. In the guidelines released this week, China’s top court signaled that the precedents from the case should be more broadly applied.

Guo and the Hangzhou Safari Park did not respond to requests for comment.

At Wednesday’s news conference, Yang said some businesses were abusing the use of facial recognition, such as residential communities needlessly requiring facial scanning for entry. He said facial images were sensitive personal information, because it was not something an individual can easily change if it is stolen.

“If such information is leaked, it can cause great harm to individuals’ personal security and property safety,” he said. “It may even threaten public security.”

Pei Lin Wu and Alicia Chen contributed to this report.