But critics see it as potential knock-out blow for Hong Kong's freedoms and autonomy, and the Group of Seven foreign ministers on Wednesday urged China to reconsider the proposed security law.
Establishing and improving the legal system and enforcement mechanisms for the Hong Kong Special Administrative Region (HKSAR) to safeguard national security from the national level is an embodiment of the "one country, two systems" and will guarantee a steady implementation of "one country, two systems", as well as safeguarding Hong Kong's prosperity and stability, the spokesperson said.
The law Beijing is imposing on Hong Kong aims to prevent, stop and punish secession, subversion of state power, terrorism and foreign interference in the city.
"This new piece of legislation will not change Hong Kong's high degree of autonomy, and will not affect judicial independence, including that of final adjudication", she said.
At the same time, Trump and his administration are fending off damning accusations by his former national security adviser, John Bolton, that the president sought Chinese President Xi Jinping's help to win re-election during a closed-door June 2019 meeting.
They also said the decision "would jeopardize the system which has allowed Hong Kong to flourish and made it a success over many years".
The United States has also reacted harshly against China, with President Donald Trump initiating a process to revoke special treatment for Hong Kong that has helped make the territory an attractive investment destination and global financial hub. "She said people "don't need to worry" about this because at the end of the day, it is for Hong Kong's authorities to enforce the law".
Beijing says the law will return stability and leave political freedoms intact, and that Hong Kong's legislature has failed to pass its own national security laws over the years.
Senior opposition figures have also been arrested for taking part in demonstrations and questions have arisen over whether the national security legislation will be used to disqualify pro-democracy candidates in September's elections for the Beijing-controlled Legislative Council.
"We strongly urge the Government of China to re-consider this decision", it said.
This year, the coronavirus outbreak brought a lull in protests but they have resumed since Beijing announced the plan for the security law.
"Both laws include principles such as presumption of innocence, the right for criminal suspects and defendants to have legal defence, and laws not being applied restrospectively".
Deng Zhonghua, deputy director of the Hong Kong and Macau Affairs Office-Beijing's agency for handling those territories' policies-said on Monday that China's central authorities should have the power to exercise jurisdiction over "most serious national security cases" in Hong Kong under the national security law.
"Everything we know about it so far suggests it will threaten the basic rights and freedoms of people in Hong Kong." the letter said.
Meanwhile the United Kingdom which views the law as a breach of the handover deal and in response has said it will look into extending the immigration rights of those with British National (Overseas) passport status, including a possible "path to citizenship".