Photo/Illutration A person dressed as U.S. President Donald Trump waves an American flag as they stand on a street in Hong Kong on Oct. 31. (AP Photo)

BEIJING--China vowed Friday to prevent foreign powers interfering in Hong Kong's affairs and carrying out acts of "separatism, subversion, infiltration and sabotage."

The latest broadside against alleged foreign backing of anti-government protesters came Friday from a top-ranking member of China's ceremonial parliament, the National People's Congress.

Shen Chunyao was elaborating on a reference in a Communist Party document that says Beijing would "establish and strengthen a legal system and enforcement mechanism for safeguarding national security" in Hong Kong, which has been roiled by five months of increasingly violent pro-democracy rallies.

"We absolutely will not permit any behavior that challenges the bottom line of 'one country, two systems,'" Shen said, referencing the governing framework under which Hong Kong was handed over from British to Chinese rule in 1997.

"We absolutely will not permit any behavior encouraging separatism or endangering national security and will resolutely guard against and contain the interference of foreign powers in the affairs of Hong Kong and Macao and their carrying out acts of separatism, subversion, infiltration and sabotage," he told reporters.

Hong Kong, which has a separate legal system under its own mini-Constitution known as the Basic Law, has tried to enact anti-subversion legislation before, only to have the measure shelved amid formidable public opposition.

Shen may now be indicating that Beijing is preparing to take matters into its own hands by having the National People's Congress issue a legal interpretation forcing the enactment of such legislation.

Article 23 of the Basic Law requires that the Hong Kong Special Administrative Region "enact laws on its own to prohibit any act of treason, secession, sedition, subversion against the Central People's Government."

It would also forbid foreign political organizations or bodies from conducting political activities in Hong Kong and ban Hong Kong political bodies from forging ties with foreign political organizations.

That would bring conditions in Hong Kong closer in line to those in China, where the government allows no political opposition to Communist Party rule and harasses or jails all who challenge its authority. That includes independent legal, civil rights and labor activists, and those defending the native religions, cultures and languages of minority peoples such as Buddhist Tibetans and Turkic Muslim Uighurs.

Hong Kong has already taken a hard line on demands that candidates for office endorse the "one country, two systems" formula and explicitly rule out the possibility of Hong Kong becoming independent of Beijing.

To drive home the point, Hong Kong authorities on Tuesday barred pro-democracy activist Joshua Wong from running as a local councilor, even as the city's leader warned that the protests that began in June have pushed the city to the brink of recession.

Hong Kong's leader, Chief Executive Carrie Lam, said there would be no political solution until the violent protests gripping the semiautonomous Chinese territory end.

The current round of demonstrations was sparked by concern over proposed extradition legislation that could have led to Hong Kong citizens facing torture and unfair trials in mainland Chinese courts.

More broadly, it reflects deep unease over an erosion of such rights and liberties, which are denied to people living under communist rule in the Chinese mainland and which Hong Kong was promised would be retained until 2047.

The extradition legislation was eventually formally withdrawn, but the authorities have rejected calls for Lam to resign and for an independent inquiry into the handling of the protests by the police. Meanwhile, the protesters have widened their demands, seeking greater democracy.