BEIJING -- China vowed Friday to prevent foreign powers from 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 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 will "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 behaviour 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 behaviour 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 mainland 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 labour 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 councillor.

Hong Kong's leader, Chief Executive Carrie Lam, said there would be no political solution until the violent protests gripping the semi-autonomous 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.

Protesters engaged in a standoff with police around the nightlife district of Lan Kwai Fong on Halloween night Thursday, and officers fired tear to move crowds back. There was no immediate word of injuries or arrests.

Elsewhere in the working class district of Mong Kok, the scene of many previous protests, demonstrators started fires in the street, damaged city property and beat one man into unconsciousness, police spokesman Tse Chun-chung told reporters. A protester also used an illegal stun gun on the man, who was left with life-threatening injuries, Tse said.

Police elsewhere found homemade bombs on a pedestrian flyover that were made from gas canisters used for cooking that can be "highly dangerous and destructive when ignited," Tse said.

Since Monday, police have arrested 249 people, 74 of them women, aged between 13 and 61, Tse said. They were charged with offences including unlawful assembly, possessing offensive weapons and wearing facial coverings at an unlawful assembly. Well over 1,000 people have been arrested in total since protests began.

"The seizure of stun guns and home-made mechanical bombs is a bad omen for Hong Kong as such dangerous weapons have fallen into the hands of those with ill intentions," Tse said. "It is imperative that we all do what we can to end this violence."