China's sweeping national security law for Hong Kong has sharply divided opinion both inside the financial hub and beyond its borders.

Beijing loyalists and China-friendly nations have hailed it.

Many dissidents, rights groups and western governments have decried it as the end of the city's free speech traditions and judicial autonomy.

Ahead of the territory's handover from Britain, authoritarian China guaranteed Hong Kong civil liberties -- as well as judicial and legislative autonomy -- until 2047 in a deal known as "One Country, Two Systems".

Here's how the world has reacted to the new law:

Hong Kong's pro-Beijing leader Carrie Lam on Wednesday described the security law as "the most significant development" since the city's handover to China.

Beijing described the law as a "sword" that would hang over the heads of lawbreakers after a year of huge and often violent pro-democracy protests.

On Wednesday, Zhang Xiaoming, deputy of Beijing's Hong Kong office, described threats of sanctions by foreign countries as "gangster logic". He added Beijing could have simply applied mainland law had it wanted to abandon "One Country, Two Systems".

Criticism poured in from Hong Kong's pro-democracy figures.

The Democratic Party said the legislation marked the end of "One Country, Two Systems" and "completely destroys Hong Kong's judicial independence".

The Labour Party said it feared dissidents would share the same fate as those on the mainland who are frequently jailed under Beijing's own national security laws.

The Civic Party said the legislation replaces "rule of law" with "rule of men".

"This rule of terror might create a false appearance of controlled social order, but it completely loses Hong Kong people's hearts," the party said.

China's sweeping new national security law for Hong Kong has sharply divided opinion inside and beyond the city
China's sweeping new national security law for Hong Kong has sharply divided opinion inside and beyond the city AFP / Anthony WALLACE

"Today marks a sad day for Hong Kong, and for freedom-loving people across China," Secretary of State Mike Pompeo said after the law was passed.

"(China) promised 50 years of freedom to the Hong Kong people, and gave them only 23," he said, adding further US countermeasures would be announced.

Washington has previously announced Hong Kong no longer has sufficient autonomy from the mainland to justify special trade privileges.

"Per President (Donald) Trump's instruction, we will eliminate policy exemptions that give Hong Kong different and special treatment, with few exceptions," Pompeo added.

In Congress, a group of bipartisan legislators tabled a bill that could provide refugee protection for Hong Kongers.

Hong Kong's former colonial master Britain described the law as a "grave step" and "deeply troubling".

But it said it needed more time to determine whether Beijing has breached its "One Country, Two Systems" promise.

Prime Minister Boris Johnson has previously offered to extend visa rights to millions of Hong Kongers if the law was pushed through.

Chris Patten, the last colonial governor of Hong Kong, called the law "the end" of "One Country, Two Systems".

"It is a flagrant breach of the Sino-British Joint Declaration -- a treaty lodged at the United Nations -- and Hong Kong's mini constitution, the Basic Law," he added.

Twenty-seven countries -- including Britain, France, Germany, Australia and Japan -- issued a rare oral rebuke of China at the UN Human Rights Council in Geneva, describing "deep and growing concerns" over the new law.

They urged China to reconsider, saying the law "undermines" the city's freedoms.

The signatories added that the law was imposed without the direct participation of Hong Kong's people, its legislature or judiciary.

Another 53 countries, led by China ally and fellow one-party state Cuba, announced support for the law at the Geneva meeting.

"The legislative power on national security issues rests with (the) state, which in essence is not a human rights issue," the statement said, according to Chinese state media.