New Hong Kong security laws came into effect on Wednesday that will punish crimes of secession, subversion, terrorism and collusion with foreign forces with up to life in prison, heralding a more authoritarian era for China's freest city.

Hong Kong authorities threw a security blanket across the city early on Wednesday, the 23rd anniversary of the former British colony's handover to Chinese rule, only hours after Beijing imposed the new national security laws on the city.

Dozens of foreign countries, including Britain and the United States, have decried the security laws, saying Beijing must preserve the right to assembly and free speech in the Asian financial hub.