HONG KONG (Reuters) - Police fired pepper spray in running battles with thousands of demonstrators on the streets of Hong Kong on Sunday as they tried to encircle China’s representative office in protest against Beijing’s attempts to stop independence activism.

Streets filled with mostly young people, many dressed in black, brought to mind weeks of pro-democracy marches in 2014.

This time they were protesting before a ruling due on Monday that is expected to bar two lawmakers from taking office in Hong Kong’s legislature.

The situation is seen by many of the territory’s legal and political elite as one of the biggest tests of Hong Kong’s independent rule of law that the global financial hub has faced since its handover to China nearly two decades ago.

Critics say the ruling from a top committee of China’s parliament essentially circumvents local courts.

The two lawmakers, Yau Wai-ching and Baggio Leung, had pledged allegiance to the “Hong Kong nation” and displayed a “Hong Kong is not China” banner during a swearing-in ceremony for the city’s legislative council in October. Their oaths were not accepted and their right to retake them is being challenged in the local courts by the autonomous Hong Kong government.

Close to a thousand police officers, some with riot shields and batons, and some behind temporary metal barricades, were deployed to prevent protesters surging toward the central government’s Liaison Office, viewed by many as a symbol of Beijing’s increasing influence on the free-wheeling city.

Chanting “Hong Kong Independence” among other slogans, the protesters, some with medical masks and cling film to shield their eyes, tried repeatedly to charge through police lines but were forced back. Several were arrested.

Also reminiscent of the 79-day democracy protests two years ago, many opened umbrellas to protect themselves from pepper spray and blocked a major road running past the China Liaison office, erecting makeshift barricades out of bamboo, wood and rubbish bins to hamper traffic.

Slideshow ( 13 images )

“We can’t just wait to die,” said 60-year-old protester Alexandra Wong who sat in the middle of the road with a yellow umbrella. “We must come out and resist, to wake up more people to the risks of China destroying our way of life.”

The protesters were eventually dispersed by police after a nearly six-hour standoff.

“SEVERE BLOW” TO RULE OF LAW

Calls for independence are considered taboo by Beijing’s Communist Party leaders who see Hong Kong as an “inalienable” part of China after more than a century of British rule.

The standing committee of China’s parliament, the National People’s Congress, this weekend discussed invoking a rarely used power to interpret Hong Kong’s mini “Basic Law” constitution to stop Yau, 25, and Leung, 30, from taking office.

China Central Television quoted national lawmakers as saying the pair were a threat to China’s “sovereignty and security”.

“If this kind of situation continues it will harm the immediate interests of the people of Hong Kong ... and the interests of national development. The Central Government cannot sit by indifferently,” they were quoted as saying.

As such, an NPC interpretation was “very timely and extremely necessary”, the report said.

Slideshow ( 13 images )

Under a “one country, two systems” formula by which Hong Kong was returned to China in 1997, Beijing promised to grant the city a high degree of autonomy, including judicial freedom.

Martin Lee, a veteran democrat and barrister, said Beijing’s move to interpret the Basic Law would bind the hands of the Hong Kong court that will hear the government’s challenge against the pair.

“(It) makes it impossible for the court to exercise its own judgment,” he said.

The Hong Kong Bar Association has said an intervention by Beijing now would deal a “severe blow” to the city’s judicial independence and undermine international confidence in Hong Kong’s autonomy. Chinese officials are expected to call a news conference on Monday morning regarding the situation.

Earlier on Sunday, thousands - including Yau and Leung -marched to the city’s financial district in protest. Organisers put the numbers at 11,000 while police said 8,000 turned out.