HONG KONG — Officially, admitted leaker Edward Snowden was able to leave Hong Kong because U.S. authorities made a mistake in their arrest request, but the semiautonomous Chinese city also indicated displeasure over Snowden’s revelation that the former British colony had been a target of American hacking.

Beijing, meanwhile, says it had nothing to do with allowing the former National Security Agency contractor to fly to Russia on Sunday. But analysts believe the move was orchestrated by China to avoid a prolonged diplomatic tussle with the U.S. over his extradition.

Snowden slipped out of Hong Kong on an Aeroflot flight to Moscow and was expected to transit through Cuba and Venezuela en route to possible asylum in Ecuador. His journey illustrates how the United States finds itself with few friends as it tries to apprehend the former CIA technician, who disclosed information on top-secret surveillance programs.

Snowden, who had been hiding in Hong Kong for several weeks, had also revealed to a local newspaper details about the NSA’s hacking of targets in Hong Kong. The revelations ratcheted up tensions between Washington and Beijing, which for months has been trying to counter U.S. accusations that its government and military are behind computer-based attacks against America.

The Hong Kong government said it allowed Snowden to leave because the U.S. request to provisionally arrest Snowden did not comply with legal requirements. At the same time, however, it mentioned that it asked the U.S. for more information on the hacking, suggesting the issue played some role in its decision.

While Hong Kong has a high degree of autonomy from the rest of China, experts said Beijing orchestrated Snowden’s exit to remove an irritant in Sino-U.S. relations.

“The central government had to have intervened since this is an issue of international relations and national security,” said Shen Dingli, director of the Center for American Studies at Shanghai’s Fudan University.

Ultimately, Shen said, China compromised by deciding to neither grant Snowden protection nor hand him over as the U.S. requested. That approach has the advantage of heading off a crisis in relations with the U.S. and demonstrating to Washington that Beijing values the overall relationship over any advantage it might gain from keeping Snowden, Shen said. He said handing Snowden over would have been an unpopular move within China.

The Global Times, published by the ruling Communist Party, said in an editorial that Snowden “has performed a service” by uncovering “the sordid tale of how the U.S. government violates the rights of its citizens and conducts cyber spying throughout the entire world.”

China’s Foreign Ministry distanced itself from any role in Snowden’s departure from Hong Kong, saying Monday the territory had the right to make its own decision.

In a routine briefing with reporters, Hua said Beijing has “always respected” Hong Kong’s ability to deal with such matters through its legal system.

Hua also raised Beijing’s concerns about cybersecurity in light of Snowden’s allegations, saying that the Chinese government has brought the issue up directly with Washington.

“We are seriously concerned about the cyberattacks that the relevant U.S. government agencies carried out on China as have been recently reported,” she said. “This demonstrates again that China is a victim of cyberattacks.”

Hong Kong lawmaker and lawyer Albert Ho said he suspects authorities in Beijing were calling the shots.

He said his firm had been representing Snowden in an effort to clarify his legal situation with the government. Snowden wanted to know what his circumstances would be like in the event he was arrested and whether he would be able to leave the city if he wanted. Ho said an intermediary who claimed to represent the government relayed a message to Snowden saying he was free to leave and should do so.

Ho said he didn’t know the identity of the intermediary and wasn’t sure whether the person was acting on Hong Kong’s or Beijing’s behalf.

“The entire decision was probably made in Beijing and Beijing decided to act on its best interests,” Ho told reporters. “However, Beijing would not want to be seen on stage because it would affect Sino-U.S. relations. That’s why China has somebody acting in the background.”

Under Hong Kong’s mini-constitution, the city is allowed a high degree of autonomy from mainland Chinese authorities until 2047. It also has its own legal and financial system, a holdover from the British colonial rule that ended in 1997.

When asked by reporters whether he took directions from Beijing, Hong Kong leader Leung Chun-ying said the territory is only required to communicate and discuss matters involving foreign affairs with the central government.

Ho also revealed a few more details about Snowden’s life in hiding in Hong Kong, saying he had been living in a “private place” after he was forced to check out of the hotel where he was staying once he was discovered by journalists.

“Most of the time he did not leave the place where he was living, though once or twice he changed locations,” Ho said.

“He only left at night, very carefully. He didn’t want anyone to see him. He was very cautious.”

Ho said Snowden lived in a “very small place. Fortunately he had a computer. He could contact anyone in the world.”

___

Christopher Bodeen in Beijing contributed to this report.

<B>Caption 1:<B>

A TV screen shows a news report of Edward Snowden, a former CIA employee who leaked top-secret documents about sweeping U.S. surveillance programs, at a shopping mall in Hong Kong Sunday, June 23, 2013. The former National Security Agency contractor wanted by the United States for revealing two highly classified surveillance programs has been allowed to leave for a “third country” because a U.S. extradition request did not fully comply with Hong Kong law, the territory’s government said Sunday. (AP Photo/Vincent Yu)

<B>Caption 2:<B>

Journalists show passengers arriving from Hong Kong a tablet with a photo of Edward Snowden, a former CIA employee who leaked top-secret documents about sweeping U.S. surveillance programs, at Sheremetyevo airport, just outside Moscow, Russia, Sunday, June 23, 2013. The former National Security Agency contractor wanted by the United States for revealing two highly classified surveillance programs has been allowed to leave for a “third country” because a U.S. extradition request did not fully comply with Hong Kong law, the territory’s government said Sunday. (AP Photo/Alexander Zemlianichenko)