Hundreds turned out to protest the legislation in the busy shopping district of Causeway Bay but were met with a heavy security presence. Riot police fired pepper spray into the crowd, kettled and dispersed protesters, and deployed water cannons.
During the protest, Hong Kong police made the first arrests under the new law, including a man who was holding a black independence flag, and soon afterward a woman with a sign reading "Hong Kong Independence."
In vague language, the legislation criminalizes secession, subversion, terrorism, and collusion with foreign powers. People convicted of such crimes can face sentences of up to life in prison.
Fearing they could be targeted under the new law, several political and activist groups in the city formally disbanded in advance of the law being introduced Monday. On the streets, the effects could be seen elsewhere too, as shopkeepers tore down posters that supported anti-government protests, and many citizens hastily deleted social media posts and accounts.
One passerby, who only gave the initial JM, and his daughter said they would now consider using a virtual private network (VPN) to protect themselves online and would even consider leaving the city.
"Its hard to not self-censor. I think most people will be more cautious," they said. "Even though I don't want to leave (Hong Kong) it's time that I need to think about it."
July 1 is traditionally a day of protests in the city but for the first time since handover, police did not give permission to protesters to hold peaceful demonstrations.
Despite the threat of stricter penalties, several hundred protesters did turn out chanting and waving flags. Police demanded they stop shouting pro-independence slogans -- they also unfurled a purple flag warning protesters of being in violation of the new law.
On June 30, police commanders were told in a training session that anybody seen waving an independence flag or chanting for independence should be arrested, a police source said -- as should anyone found in possession of independence flags.
On Wednesday, Hong Kong's top official, Chief Executive Carrie Lam, said the law is a "crucial step to ending chaos and violence that has occurred over the past few months" in the city.
"The national security law is the most important development in securing ties between China and the Hong Kong Special Administrative Region since the handover," she said, framing criticism of the law as "vicious attacks."
Here are some of the key takeaways of the law, according to a translation from Chinese state news agency Xinhua.
Those found guilty could face life in prison:
China can take over cases and hold secret trials with no jury:
This will affect foreigners, news organizations, international companies:
Other significant parts of the law:
Opponents of the law say it marks the end of the "one country, two systems" -- a principle by which Hong Kong has retained limited democracy and civil liberties since coming under Chinese control.
Crucially, those freedoms include the right to assembly, a free press, and an independent judiciary, rights that are not enjoyed on the Chinese mainland.
On Wednesday, the Chinese government staunchly defended the law, calling it a perfect embodiment of the "one country, two system" policy.
"If we want to implement 'one country, one system,' things would have been much simpler," said Zhang Xiaoming, executive deputy director of China's Hong Kong and Macao Affairs Office. "We could have directly applied Chinese criminal code, prosecution law and national security law to Hong Kong. Why would we go to such lengths to tailor-make a national security law for Hong Kong?"
Officials also brushed aside concerns over the law's impact on freedom of speech, judicial independence and political diversity, reiterating that it targets only a tiny minority of people who intend to do real harm to Hong Kong.
Shen Chunyao, director of legislative affairs commission of the National People's Congress Standing Committee, China's top lawmaking body, which passed the new law, said only under "very rare" circumstances would Chinese state security agents and judicial authorities get involved in Hong Kong cases.
"We don't want to see (such occurrences), but we must set up a system that take such risks and factors into consideration," he said.
Michael Tien, Hong Kong's Deputy to the National People's Congress, said the law was being blown "out of proportion" and that its main purpose was to "act as a deterrent."
"It's a short, sharp sword hanging over a minority of people," Tien said. He added that he believes cases in which Beijing steps in and sends people to the mainland to be tried will be a "different level of crime."
"I do not call rocking a bus or paralyzing the Hong Kong public transport as an imminent threat to national security," he said.
But Jimmy Lai, a Hong Kong media tycoon known for his outspoken support of the city's pro-democracy movement, said the law "spells a death knell to Hong Kong because it supersedes our law and our rule of law."
Rights group Amnesty International said the legislation "represents the greatest threat to human rights in the city's recent history."
United States Secretary of State Mike Pompeo said it was a "sad day for Hong Kong, and for freedom-loving people across China" with the imposition of the national security legislation in Hong Kong.
He said the law "destroys the territory's autonomy and one of China's greatest achievements."
CNN's Steven Jiang, James Griffiths, Roger Clark, Karina Tsui, Anna Kam, Jessie Yeung, Jadyn Sham, Vanesse Chan, Chermaine Lee, Kylie Atwood, Philip Wang contributed.