China has yet to make public the full text of the law, which it claims has widespread support in Hong Kong.
The European Union expressed anger on Tuesday at a decision by China's parliament to pass national security legislation for Hong Kong despite an global outcry.
She said the law would only target a "small minority" and would not undermine Hong Kong's autonomy, adding: "We respect differences in opinion".
The Trump administration announced the decision hours after China said it would curb visas to some Americans heading to Hong Kong in response to an earlier move by the US.
He added: "We would urge China to step back from the brink, respect the rights of the people of Hong Kong and frankly live up to its worldwide obligations through the joint declaration and to the global community".
But "for the vast majority of Hong Kong residents and foreigners in Hong Kong, this law is a guardian spirit that protects their freedoms", the Hong Kong and Macau Affairs Office said.
Japanese Chief Cabinet Secretary Yoshihide Suga called the passage of the security laws "regrettable" at a regular news briefing, adding that it would "undermine the trust of the global community in the "one country, two systems" principle", which he said is "extremely important" to Japan.
Kwok said what Beijing had done was a "ruthless way of taking away the freedoms and human dignity of the Hong Kong people".
Joining the worldwide criticism was NATO Secretary-General Jens Stoltenberg, who said during a Tuesday virtual forum, "It is clear that China does not share our values-democracy, freedom, and the rule of law", according to Reuters.
Hailing the legislation, Lam said the HKSAR government will complete the necessary procedure for publication by gazette as soon as possible to enable the implementation of the law in Hong Kong in tandem. "With sweeping powers and ill-defined law, the city will turn into a #secretpolicestate", he tweeted.
Beijing and Hong Kong's government reject those allegations. This act allowed Hong Kong to have its own export control system and made it a territory where the USA tariffs on Chinese goods did not apply.
China's security agencies will also be able to set up shop publicly in the city for the first time.
In addition, the city will have to establish its own national security commission to enforce the laws, with a Beijing-appointed adviser.
The 50-year agreement is said to implement a "one country, two systems" principle, because it offers Hong Kong rights and freedoms that do not exist in mainland China.
The city's July 1 holiday, which marks the 23rd anniversary of the handover, has always been marked by a large protest march by opposition groups, under the umbrella of the Civil Human Rights Front, the organizer of last year's massive rallies.
However, the answer requires "strong coordination with all member states", Charles Michel, president of the European Council added.
Rights groups, many western governments and the Unitied Nations' rights body have expressed alarm over the law.
Chris Patten, the last British governor of the territory, said in a statement that the decision marked "the end of one-country, two-systems".
The United States began eliminating Hong Kong's special status under USA law on Monday, halting defence exports and restricting the territory's access to hi-tech products as China prepares new Hong Kong security legislation.
In a largely symbolic move, the United States on Monday ended sensitive defence exports to Hong Kong over the law.