China's sweeping national security law for Hong Kong will target only a tiny minority, the city's chief executive told the UN, urging international "respect" for its right to protect national security.

Speaking via video message to the UN Human Rights Council in Geneva, Carrie Lam defended the law approved by China's rubber-stamp parliament.

The Beijing-appointed leader insisted Hong Kong had been living with "a gaping hole in national security" and that the law was "urgently needed".

Ms Lam said the legislation would help heal a city "traumatised by escalating violence fanned by external forces".

The legislation, she said, "aims to prevent, curb and punish acts of secession, subversion of state power, terrorist activities, and collusion with foreign or external forces to endanger national security."

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

The European Union said it deplored the adoption of the law, which it warned would undermine Hong Kong's autonomy and undercut the judiciary.

European Council President Charles Michel said: "This law risks seriously undermining the high degree of autonomy of Hong Kong and having a detrimental effect on the independence of the judiciary and the rule of law."

Ms Lam downplayed fears it could be used to stifle criticism of Beijing.

"It will only target an extremely small minority of people who have breached the law, while the life and property, basic rights and freedoms of the overwhelming majority of Hong Kong residents will be protected," she said.

She also insisted that "the law will not affect Hong Kong's renowned judicial independence".

As part of the 1997 handover from Britain, Hong Kong was guaranteed certain freedoms - as well as judicial and legislative autonomy - for 50 years in a deal known as "One Country, Two Systems".

"Hong Kong is an inalienable part of China," Ms Lam said, accusing foreign governments or politicians who object to the legislation of "double standards".

"All those countries which have pointed their fingers at China have their own national security legislation in place," she said.

"We could think of no valid reason why China alone should be inhibited from enacting national security legislation to protect every corner of its territory and all of its nationals.

"I urge the international community to respect our country's right to safeguard national security and Hong Kong people's aspirations for stability and harmony."

"The fact that Hong Kong people will only come to know what's really in this new law after the fact is more than preposterous," said Claudia Mo, an opposition politician.

"It marks the end of Hong Kong that the world knew before," prominent democracy campaigner Joshua Wong tweeted.

"With sweeping powers and ill-defined law, the city will turn into a #secretpolicestate."

There has been widespread opposition to the Chinese move in Hong Kong

Move seen as a 'fundamental change'

Critics have long accused Beijing of chipping away at "One Country, Two Systems" status, but they describe the security law as the most brazen move yet.

A summary of the law published by the official state agency Xinhua this month said China's security agencies would be able to set up shop publicly in the city for the first time.

Beijing has also said it will have jurisdiction over some cases, toppling the legal firewall that has existed between Hong Kong and the mainland's party-controlled courts since the 1997 handover from Britain.

Analysts said the security law radically restructures the relationship between Beijing and Hong Kong.

"It's a fundamental change that dramatically undermines both the local and international community's confidence towards Hong Kong's "One Country, Two Systems" model and its status as a robust financial centre," said Hong Kong political analyst Dixon Sing.

Restore stability

On the mainland, national security laws are routinely used to jail critics, especially for the vague offence of "subversion".

Beijing and Hong Kong's government reject those allegations.

Four young democracy campaigners, including Joshua Wong, said they were stepping down from the party they founded while a small pro-independence group said it was disbanding.

Pro-democracy activists Nathan Law, Joshua Wong and Agnes Chow

Millions took to the streets last year while a smaller hardcore of protesters frequently battled police in increasingly violent confrontations that saw more than 9,000 arrested.

Hong Kong banned protests in recent months, citing previous unrest and the coronavirus pandemic, although local transmissions have ended.

Some western nations warned of potential repercussions for Beijing ahead of the security law's passing.

However many are wary of incurring Beijing's wrath and losing lucrative access to the mainland's huge economy.

Pro-China supporters gathered to welcome the new law

Taiwan, which has said it is willing to help Hong Kongers relocate to the island, was one of the first governments to react.

"The government condemns this move that seriously affects freedom, human rights and stable development in Hong Kong society," the cabinet said in a statement.

The US, which has embarked on a trade war with China, has said the security law means Hong Kong no longer enjoys sufficient autonomy from the mainland to justify special status.

In a largely symbolic move, the US yesterday ended sensitive defence exports to Hong Kong over the law.

Britain had said it was willing to provide a "pathway to citizenship" for millions of Hong Kongers if the security law went ahead.