In the single strange month he spent in Hong Kong, Edward Snowden evolved from a tourist to a fugitive to an icon, and, finally, an irritant. And, in the end, the governments with the power to decide his fate—Hong Kong and Beijing—faced a choice: the short-term pain of defying a U.S. request for coöperation, or the long-term anguish of sheltering a man whose biography had become a symbol in China and abroad. They chose the former, and now both the U.S. and China are left to pick up the pieces.

Snowden, the former contractor with the U.S. National Security Agency who decided to release details of U.S. spying programs, had been in Hong Kong since May 20th, when he arrived in search of a venue that would allow him enough time to release his trove of highly classified materials. The U.S. government asked Hong Kong to detain him, but local authorities issued an objection to the request, and, on Sunday, allowed America’s most famous fugitive-spy to leave Chinese territory and fly to Moscow, with plans, perhaps, to continue to Ecuador, or elsewhere. (The Beijing government, which exercises control over foreign affairs in semi-independent Hong Kong, will probably never acknowledge its direct role in this affair, but it left many fingerprints.)

American authorities were stunned. “For some reason Hong Kong and China wanted to let Snowden get away and this is a direct slap at the U.S.,” Congressman Peter King, the New York Republican, said after the news broke. Richard Haass, the president of the Council on Foreign Relations, called China’s decision to let Snowden go “lose-lose and strategically shortsighted.”

It’s true that this is likely to sap some goodwill from the U.S.-China relationship, though a drawn-out extradition battle would have been even messier. From Beijing’s perspective, Snowden was an asset of diminishing value: he had already given Chinese authorities a gift that will be paying dividends for years to come. In an interview, he said that the N.S.A. “does all kinds of things like hack Chinese cell phone companies to steal all of your SMS data”; he described the hacking of university computers in Beijing and of systems run by Pacnet, a telecommunications company. Xinhua, the state news agency, responded with glee. “These, along with previous allegations, are clearly troubling signs. They demonstrate that the United States, which has long been trying to play innocent as a victim of cyber attacks, has turned out to be the biggest villain in our age.”

In China, Snowden left an astonishing feat in his wake: he actually improved the credibility of government censors and information-security czars, who make up one of China’s most unloved groups. Fang Binxing, a computer scientist known as the “father of the Great Firewall” for his role in developing China’s censorship régime, is so unpopular among his countrymen that he has been pelted with eggs and shoes while giving speeches; when he opened a social-media account in 2010, people called him a “eunuch” and a “running dog” and someone Photoshopped his head onto a voodoo doll. For years, Fang justified government intervention on the Web largely by arguing, as he once did, that unseen enemies abroad “sit comfortably at home, thinking only of how, through their fingertips on a keyboard, they can bring chaos to China.” He warned that using telecom equipment from international companies like Cisco threatened China’s national security. Snowden has given Fang and his cohort new reasons to argue for stricter control of the Web.

But, over time, Snowden was becoming popular in China for reasons that the government almost certainly found intolerable. China may have invented the whistle, but today’s Communist Party has little appetite for whistleblowers—and Snowden’s popularity as a digital renegade was not going to be allowed to grow forever. His usefulness was almost exhausted. Intelligence experts cited by the Times believed that the Chinese government “had managed to drain the contents of the four laptops that Mr. Snowden said he brought to Hong Kong, and that he said were with him during his stay at a Hong Kong hotel.”

Last week, I was asked on the Sinica Podcast, by the host Kaiser Kuo, whether I thought Snowden’s revelations have affected U.S.-China relations. I said no, on the principle that both sides already knew the general parameters of each others’ espionage efforts. After watching the events of this weekend, I’m quite sure I was wrong: Snowden has indeed altered U.S.-China relations, by giving China new strength on an issue of which it was struggling to gain any leverage at all. And that—more than any single secret—may be the greatest legacy of Snowden’s visit to Hong Kong.

Photograph by Kin Cheung/AP.

[#image: /photos/59095103ebe912338a37265d]

Read more of our coverage of government surveillance programs.