Hong Kong police arrested about 370 people Wednesday -- including 10 under China's new national security law -- as thousands defied a ban on protests on the anniversary of the city's handover to China.

Beijing said the law would restore stability after nearly a year of unrest, but instead it sparked the worst street violence in months.

Police said seven officers were injured -- one was stabbed in the shoulder as he tried to make an arrest, and three others were hit by a "rioter" on a motorcycle.

Under the new law, certain political views and symbols became illegal overnight -- including showing support for Hong Kong, Taiwan, Xinjiang and Tibet independence.

Outline of main points that could be covered in the new national security law that China imposed on Hong Kong on Tuesday Outline of main points that could be covered in the new national security law that China imposed on Hong Kong on Tuesday Photo: AFP / John SAEKI

Details released by police Wednesday accused those arrested under the new legislation of possessing independence flags, stickers and flyers.

"Advocacy for independence of Hong Kong is against the law," security minister John Lee told reporters.

Still, many of those protesting chanted independence slogans -- itself now against the law.

A barge with banners marking the passing of the national security law floats in Victoria Harbour on the 23rd anniversary of Hong Kong’s handover from Britain to China A barge with banners marking the passing of the national security law floats in Victoria Harbour on the 23rd anniversary of Hong Kong’s handover from Britain to China Photo: AFP / Anthony WALLACE

"What this authoritarian regime wants to do is to terrorise the people and stop them from coming out," Chris To, a 49-year-old protester, told AFP.

Riot police used pepper spray and made arrests as protesters defied a ban to gather in the popular Causeway Bay shopping district Riot police used pepper spray and made arrests as protesters defied a ban to gather in the popular Causeway Bay shopping district Photo: AFP / DALE DE LA REY

Opprobrium over the law poured in from critics and western governments -- led by the United States and Britain -- over fears the law will usher in a new era of mainland-style political repression.

Under a deal ahead of the 1997 handover from Britain, authoritarian China guaranteed Hong Kong civil liberties as well as judicial and legislative autonomy until 2047 in a formula known as "One Country, Two Systems".

A woman reacts after being hit by pepper spray as police tried to stop protests in Hong Kong A woman reacts after being hit by pepper spray as police tried to stop protests in Hong Kong Photo: AFP / DALE DE LA REY

British foreign secretary Dominic Raab said the law breached that agreement, a registered treaty.

Britain also said it would push ahead with previously announced plans to extend a possible path to citizenship for some three million Hong Kongers.

Washington has vowed unspecified counter-measures, but Democratic presidential hopeful Joe Biden slammed the administration of Donald Trump for not doing enough.

Hong Kong leader Carrie Lam hailed the legislation as the "most important development" since the city's return to Beijing's rule in 1997 Hong Kong leader Carrie Lam hailed the legislation as the "most important development" since the city's return to Beijing's rule in 1997 Photo: AFP / Daniel SUEN

Biden said Trump had "surrendered our values and reassured China's autocrats they have a like-minded partner in the White House."

Beijing said foreign countries should keep quiet about the law, while Hong Kong leader Carrie Lam hailed the legislation as the "most important development" since the city's return to Beijing's rule.

A barge with banners marking the passing of the national security law floats in Victoria Harbour on the 23rd anniversary of Hong Kong’s handover from Britain to China A barge with banners marking the passing of the national security law floats in Victoria Harbour on the 23rd anniversary of Hong Kong’s handover from Britain to China Photo: AFP / Anthony WALLACE

After huge and often violent pro-democracy protests last year, authorities have shown zero tolerance for even peaceful rallies in recent months.

Gatherings of more than 50 people are banned anyway under anti-coronavirus regulations -- even though local transmissions have ended.

But the July 1 anniversary has long been a polarising day in the city.

Beijing loyalists celebrate Hong Kong's return to the Chinese motherland after a century and a half of what they consider humiliating colonial rule by Britain.

Early Wednesday, helicopters flew across Victoria Harbour carrying Chinese and Hong Kong flags, while a barge chugged past hailing the law in giant Chinese characters on scaffolds.

Democracy advocates have long used the handover date to hold rallies as popular anger towards Beijing swells -- although this year's event was banned for the first time in 17 years.

During huge pro-democracy demonstrations last year, the city's legislature was besieged and trashed by protesters.

The "One Country, Two Systems" formula helped cement Hong Kong's status as a world-class business hub, bolstered by an independent judiciary and political freedoms unseen on the mainland.

But critics have long accused Beijing of chipping away at that status and describe the new security law as the most brazen move yet.

It was passed in just six weeks, skipping Hong Kong's fractious legislature, and the precise wording was kept secret until it came into effect late Tuesday.

It outlaws subversion, secession, terrorism and colluding with foreign forces to undermine national security, with sentences of up to life in prison.

It also topples the legal firewall that has existed between the city's judiciary and the mainland's party-controlled courts.

China will have jurisdiction over "serious" cases and its security agencies will also be able to operate publicly in the city for the first time.

Another provision also claims universal jurisdiction for national security crimes committed beyond Hong Kong or China.

Authorities in Taiwan opened a new office to deal with Hong Kongers seeking refuge.