HONG KONG/BEIJING (Reuters) - China said on Thursday it had the right to bar people from Hong Kong, a day after a British activist was denied entry to the former British colony, and that it had complained to Britain after it demanded an explanation.

Hong Kong returned to Chinese rule in 1997 under a “one country, two systems” formula that promises it a high degree of autonomy and freedoms not enjoyed on the mainland.

But critics have accused the government of bending to the will of Communist Party leaders in Beijing and of a gradual watering down of the territory’s freedoms, including freedom of speech and right to protest.

British Foreign Secretary Boris Johnson said he was “very concerned” that Benedict Rogers, a co-founder of the Conservative Party’s Human Rights Commission, was denied entry to Hong Kong on Wednesday and demanded an “urgent explanation” from Hong Kong and China.

It came a week before a sensitive Communist Party leadership meeting starts in Beijing.

Johnson also said Hong Kong’s high degree of autonomy, rights and freedoms were “central to its way of life”.

Rogers has been a vocal critic of China-ruled Hong Kong’s treatment of political activists, including that of jailed student leader Joshua Wong. He believes the decision to bar him was made by Chinese officials after the Chinese Embassy in London had warned him earlier, through a British member of parliament, that he wouldn’t be allowed in.

Chinese Foreign Ministry spokeswoman Hua Chunying said the central government had a responsibility for foreign matters related to Hong Kong.

“The central Chinese government and the special administrative region government handle the relevant issue in accordance with the law,” Hua said. “Allowing or not allowing people in is China’s sovereignty ... Hong Kong affairs are a purely internal matter for China.”

She said China had lodged a solemn representation with Britain, meaning an official complaint.

When asked about the incident on a radio talk show, Hong Kong leader Carrie Lam agreed.

“Ultimately, under the Basic Law (Hong Kong’s mini-constitution), the central government is responsible for foreign affairs,” Lam said.

Asked if immigration controls fell under Hong Kong jurisdiction, Lam said: “It has to be considered whether foreign affairs are involved during the process of immigration.

“If you say everything falls under Hong Kong’s high degree of autonomy, this is not what the Basic Law says.”

Rogers, speaking to Reuters shortly after arriving in London, said Beijing’s statement confirmed his assumption that the decision to boot him out was made not by Hong Kong but by Chinese authorities.

He described the interference in Hong Kong’s immigration controls as “very alarming” and “a very serious threat to ‘one country, two systems’.”

“China has now revealed its hand. The world ought to have woken up a long time ago, but I think now they really ought to wake up to what this means for ‘one country, two systems’,” he said.

“I’m very sad for what this means for Hong Kong.”

The former head of Hong Kong’s civil service turned pro-democracy activist, Anson Chan, said the case was a “serious breach” of the Basic Law.

Article 154 of the Basic Law says Hong Kong “may apply immigration controls on entry” of foreigners into Hong Kong.

“The Immigration Department must have sought instructions from on high,” she told Reuters. “They (Beijing) are sending a message that if you dare speak out on Hong Kong ... you will not be allowed in.”

Amnesty International’s East Asia director, Nicholas Bequelin, suggested China’s definition of what constitutes national security is creeping into Hong Kong.

“In China if you’re critical of the political system, you’re committing a national security crime and this is exactly the type of thing ‘one country, two systems’ should protect against.”

In response to a Reuters’ request for comment on whether China was involved in Rogers’ denial of entry, Hong Kong’s Immigration Department said it did not comment on individual cases.

China has admitted asking a group of British MPs to cancel a visit to Hong Kong in 2014 during the massive pro-democracy protests, of which Joshua Wong was a leader, that paralyzed highways for 79 days.

Hong Kong has, on occasion, barred entry to individuals including dissidents, such as former leaders of the 1989 Tiananmen Square protests in Beijing and a Danish sculptor, Jens Galschiot, who made a Tiananmen sculpture.