China announced Monday visa restrictions on US citizens who have "behaved egregiously" over Hong Kong, ahead of the expected approval by Chinese lawmakers of a controversial national security law for the city.

The country is moving forward on a security law that would punish subversion and other offences against the state in Hong Kong, which saw massive and sometimes violent pro-democracy protests last year.

On Friday, US President Donald Trump's administration said it was restricting US visas for a number of unspecified Chinese officials for infringing on the autonomy of the Asian financial hub.

In response, Chinese foreign ministry spokesman Zhao Lijian said Monday that the US "scheme... to obstruct the passage of the Hong Kong national security law will never prevail".

"To target the US's above wrongful actions, China has decided to impose visa restrictions against American individuals who have behaved egregiously on matters concerning Hong Kong," Zhao said.

China's top lawmaking committee is expected to adopt the law during sessions that end on Tuesday.

China is set to impose a national security law on Hong Kong to punish subversion in the city
China is set to impose a national security law on Hong Kong to punish subversion in the city AFP / Anthony WALLACE

The legislation was approved by Beijing's rubber-stamp parliament little more than six weeks after it was unveiled, sending shockwaves through semi-autonomous Hong Kong and beyond.

While outlawing acts of subversion, secession, terrorism and colluding with foreign forces, the legislation will allow China's security agencies to set up shop publicly in the city for the first time.

The United States, Britain, the European Union and the United Nations rights watchdog have all voiced fears the law could be used to stifle criticism of Beijing, which uses similar laws on the authoritarian mainland to crush dissent.

US Secretary of State Mike Pompeo said Washington would curb visas for unspecified current and former officials of the Chinese Communist Party "who were responsible for eviscerating Hong Kong's freedoms".

The officials targeted were "responsible for, or complicit in, undermining Hong Kong's high degree of autonomy", which Beijing promised before regaining control of the territory in 1997 from Britain, Pompeo said.

Last week, the US Senate unanimously approved a bill that would impose mandatory economic sanctions in the United States against Chinese officials and Hong Kong police identified as hurting the city's autonomous status.

Zhao warned Monday that the US "should not review, advance or implement relevant negative bills concerning Hong Kong, even less impose so-called sanctions on China, otherwise China will firmly take strong countermeasures".

Hong Kong was upended by seven straight months of protests last year, initially sparked by an eventually abandoned plan to allow extraditions to the mainland.

But they soon morphed into a popular revolt against Beijing's rule and widespread calls for democracy.