China has accused the United States of seeking to "destroy" Hong Kong and has threatened retaliation after Congress passed new legislation supporting the pro-democracy movement that has thrown the city into nearly six months of turmoil.

Key points: The legislation has yet to be signed into law by US President Donald Trump

The legislation has yet to be signed into law by US President Donald Trump Foreign Ministry spokesman Geng Shuang asked the US to stop interfering in China's internal affairs

Foreign Ministry spokesman Geng Shuang asked the US to stop interfering in China's internal affairs The legislation backs universal suffrage, freedom from arbitrary arrest, and sanctions against those who contravene

Foreign Minister Wang Yi said the passage of the Hong Kong Human Rights and Democracy Act "indulges violent criminals" that China blames for the worsening unrest and aims to "muddle or even destroy Hong Kong".

The legislation — which now awaits President Donald Trump's signature into law — backs universal suffrage, freedom from arbitrary arrest, and sanctions against those who contravene such principles.

It was passed by the House of Representatives on Wednesday (local time) despite warnings from China, which angrily rejects criticism of its handling of Hong Kong.

Foreign Ministry spokesman Geng Shuang said the Hong Kong Human Rights and Democracy Act undermined both China's interests and those of the US in the semi-autonomous Chinese city.

"We urge the US to grasp the situation, stop its wrongdoing before it's too late, prevent this act from becoming law [and] immediately stop interfering in Hong Kong affairs and China's internal affairs," Mr Geng said.

Protesters in Hong Kong urged US President Donald Trump to "liberate" the semiautonomous Chinese territory during a peaceful march to the US Consulate in September. ( AP: Kin Cheung )

"If the US continues to make the wrong moves, China will be taking strong countermeasures for sure."

The human rights act mandates sanctions on Chinese and Hong Kong officials who carry out human rights abuses and requires an annual review of the favourable trade status that Washington grants Hong Kong.

Another bill prohibits export to Hong Kong police of certain non-lethal munitions, including tear gas, pepper spray, rubber bullets, water cannons, stun guns and tasers.

'Wrong calculation'

Hong Kong's months of protest began with a now-shelved bill to allow extraditions to mainland China, which revived fears that Beijing was compromising the city's freedoms.

Millions of angry citizens have taken to the streets in giant marches, and protesters have repeatedly clashed with police in a movement that has widened to include calls for democracy and an inquiry into alleged police brutality.

Hong Kong's Beijing-appointed leaders have rebuffed the demands.

Protesters clashed with riot police at the campus of the Hong Kong Polytechnic University. ( AFP: Anthony Wallace )

The resistance has focused in recent days on the campus of the Hong Kong Polytechnic University, with fiery clashes that saw police firing tear gas and rubber bullets at protesters, who shot arrows and lobbed Molotov cocktails.

The university remained under siege on Thursday (local time), with dozens of holdouts in the movement's signature black colours defying official calls to surrender.

Hundreds have fled the campus out of fear or deteriorating living conditions this week, most of them quickly arrested by police on rioting allegations.

Exhausted protesters draped in gold and silver medical blankets continued to trickle out on Thursday (local time).

But a 30-year-old masked protester who gave his name as "Mike" scoffed at surrendering, saying international and local pressure would cause authorities to make a humiliating "retreat".

Some exhausted protesters surrendered and walked out of the campus of Hong Kong Polytechnic University. ( AFP: Anthony Wallace )

"Police are making the wrong calculation here if they think we will surrender. We have plenty of resources, plenty of food and water. We can last a month."

In some areas, materials used for making Molotov cocktails were strewn about — accompanied by warnings against smoking — and graffiti was seen throughout the campus, including messages such as "You can kill a man, you can't kill an idea."

'Naked interference in China's internal affairs'

The turmoil has already tipped Hong Kong's economy into recession and the threat of a change in trade status brought fresh gloom.

Hong Kong's benchmark stock index ended sharply lower, and other Asian markets also lost ground over fears that the rights legislation could derail the delicate effort to settle the trade war between the world's two biggest economies.

The turmoil tipped Hong Kong's economy into recession. ( AP: Kin Cheung )

Mr Wang, Beijing's top diplomat, condemned the bill as "naked interference in China's internal affairs", according to the foreign ministry, which said the comments were made during a meeting in Beijing with former US defense secretary William Cohen.

A foreign ministry spokesman also vowed that China would "take effective measures to resolutely fight back", giving no details.

Hong Kong is a semi-autonomous Chinese region and US policy treats its economy as separate from the rest of China.

That has been a key factor in the city's rise as an international financial hub, and left it exempt from the crippling tariffs imposed by Trump's administration.

The new US bill would require an annual review of that status, which could be revoked if the city's unique freedoms are quashed.

Beijing has repeatedly said it may act if Hong Kong spirals out of control, and China's state media said the US legislation would not change that calculus.

"Some may expect this to deter Beijing," the government mouthpiece Global Times said.

"Such thinking is naive."

AFP/AP