“Figuring out how to make good on our promise to stop censoring search on google.cn has been hard,” David Drummond, Google’s chief legal officer, wrote in the blog post. “The Chinese government has been crystal clear throughout our discussions that self-censorship is a nonnegotiable legal requirement.”

Mr. Drummond said that Google’s search engine based in Hong Kong would provide mainland users results in the simplified Chinese characters used on the mainland and that he believed it was “entirely legal.”

“We very much hope that the Chinese government respects our decision,” Mr. Drummond said, “though we are well aware that it could at any time block access to our services.” Some Western analysts say Chinese regulators could retaliate against Google by blocking its Hong Kong or American search engines entirely, just as it blocks YouTube, Facebook and Twitter.

Google’s decision to scale back operations in China ends a nearly four-year bet that Google’s search engine in China, even if censored, would help bring more information to Chinese citizens and loosen the government’s controls on the Web.

Image A Chinese flag flies next to the Google company logo outside the Google China headquarters in Beijing on Monday. Credit... Liu Jin/Agence France-Presse — Getty Images

Instead, specialists say, Chinese authorities have tightened their grip on the Internet in recent years. In January, Google said it would no longer cooperate with government censors after hackers based in China stole some of the company’s source code and even broke into the Gmail accounts of Chinese human rights advocates.

“It is certainly a historic moment,” said Xiao Qiang of the China Internet project at the University of California, Berkeley. “The Internet was seen as a catalyst for China being more integrated into the world. The fact that Google cannot exist in China clearly indicates that China’s path as a rising power is going in a direction different from what the world expected and what many Chinese were hoping for.”