China has warned Hong Kong that the island's autonomy could be snuffed out if it continues to challenge Beijing.

Hong Kong operates with a high level of autonomy under the "one country, two systems" policy, which allows the region to maintain its capitalist economy and much political and judicial freedom, although it was officially reunited with China in 1997.

However, this system operates at Beijing's pleasure, Wang Zhenmin, one of China's top representatives in Hong Kong, implied in comments at a seminar on Saturday.

"The more Hong Kong fails to actively defend [China's] sovereignty, national security and development interests in accordance with the law, the more wary the country will be about Hong Kong's high degree of autonomy and the 'two systems,'" Wang, a legal official at China's Central Liaison Office in Hong Kong, said. "There would be less room for its autonomy."

China would be "disappointed" to see separatists taking roles in Hong Kong's government and education systems, Wang said.

"If the ‘two systems' part… is severely distorted or even [becomes a tool] to confront and damage ‘one country', then the reasons and conditions for the ‘two systems' to exist would be lost," he cautioned.

Hong Kong has been gripped by protests and high-profile pro-democracy movements in the past few years, particularly the Umbrella Movement that occupied and shut down swathes of the city in 2014. This year, several elected members of Hong Kong's Legislative Council were disqualified for using their swearing in ceremony to display pro-democracy banners or for deliberately misspeaking their oaths of allegiance to China. Two of these legislators were arrested this week along with several other pro-democracy advocates on charges of unlawful assembly.

Hong Kong democracy activists decry Beijing's "interference" in their elections and China's ultimate control over who takes office. Wang denied that Beijing could be said to "interfere" in a process over which it is in fact sovereign.

"The country is only exercising its sovereignty in accordance with the law and that should not be regarded as ‘interference'," he said. "Just like we cannot say your brain is interfering with your limbs as they have always been part of your body. [The brain] is only carrying out its own functions."

He also warned that if the one country two systems model were to fail, Beijing would only "lose face," while "Hong Kong will lose everything."

At the same seminar, outgoing Hong Kong Chief Executive Leung Chun-ying also stressed that Hong Kong's autonomy is not "full autonomy," but is authorized by Beijing.

He also said the country's Basic Law, the formal document that promises Hong Kong its way of life and economy could be maintained for 50 years after reunification, refers only to its capitalist system. It does not mean Beijing's sovereignty over the island can be changed, he said.

"Does Wang mean Beijing is not going to realize its promise? If so, I'm afraid it would only tear Hongkongers and the central government further apart," Hong Kong Democratic Party Chairman Wu Chi-wai said in response to Leung's comments, according to the South China Morning Post.

"The Basic Law only states that the central government's power over Hong Kong is confined to national defense and foreign affairs."

Meanwhile, the EU found in its latest annual report on Macau that the one country, two systems model "continued to work very well" there last year, and that "fundamental rights and freedoms of citizens continued to be respected," according to the Macau Daily Times.

July 1 will mark the 20th anniversary of the handover of Hong Kong from the UK to China, and Chinese President Xi Jinping is expected to be on the island for the scheduled swearing in of Hong Kong's new chief executive on that day.