Earlier in the day, the Hong Kong Police Force wasted no time in announcing the first arrest made under the new law: a man at the rally who unfurled a flag bearing the phrase “Hong Kong independence".
But as Twitter users pointed out, a closer look at the banner shows there were also characters that translate to “no to” in small print in front of the slogan. It was not clear if authorities were aware of this.
Police accuse those who were detained of possessing independence flags, stickers and flyers. One 23-year-old man was reportedly arrested for riding his motorcycle into three officers with a "Liberate Hong Kong" attached to his bike.
At least 370 people were arrested in total during the rally.
Police were seen pinning demonstrators to the ground and shooting pepper balls at them, and targeting journalists with pepper spray and water cannons.
They were also seen parading large purple banners, both in English and simplified Chinese, warning the crowd that pro-democracy messages can now lead to arrests and prosecution.
“This is a police warning,” the signs read.
“You are displaying flags or banners/chanting slogans/or conducting yourselves with an intent such as secession or subversion, which may constitute offences under the ‘HKSAR National Security Law’.
“You may be arrested and prosecuted.”
What exactly does the law say?
Details of the legislation, which contains 66 articles and more than 7,000 words, were kept secret from people in Hong Kong until it came into effect.
It criminalises “secession, subversion, organisation and perpetration of terrorist activities, and collusion with a foreign country or with external elements to endanger national security.”
Those who commit such acts could face life in prison.
Pro-democracy activists say the legislation is deliberately broad and gives authorities extensive power to target people with anti-China beliefs.
"The Hong Kong Bar Association is gravely concerned with both the contents of the NSL (National Security Law) and the manner of its introduction," the influential legal association said in a statement released late Wednesday.
China says it will have jurisdiction over some cases and has empowered its security agents to operate inside Hong Kong openly for the first time, unbound by the city's laws.
However, authorities in Beijing and Hong Kong have repeatedly said the legislation is aimed at a few "troublemakers" and will not affect rights and freedoms, nor investor interests.
Hong Kong leader Carrie Lam has hailed the legislation as the "most important development" since the city's return to Beijing's rule.
She insists it will not undermine the 'one country, two systems' framework that allows the city to have legal, financial, and governmental independence from mainland China.
"The legislation will not undermine Hong Kong’s high degree of autonomy. Hong Kong is a free and diversified society," she said on Tuesday as the law was signed.
"We respect differences in opinion and thrive on reaching consensus but ... without one country, two systems will stand on shaky ground, and Hong Kong's stability and prosperity will be at risk."
What reaction has there been?
The legislation has been condemned by numerous countries, including Australia, and has Hongkongers living in Australia concerned.
Prior to the law’s passage, there were calls by rights groups for Australia to offer asylum to pro-democracy Hongkongers.
When asked by reporters on Wednesday whether Australia would do so, Prime Minister Scott Morrison confirmed the government was finalising arrangements.
“When we have made a final decision on those arrangement, then I'll make the announcements. But are you asking are we prepared to step up and provide support? The answer is yes,” he said.
Britain also announced on Wednesday it would extend around three million Hong Kong residents a broader path to citizenship.
About 350,000 British passport holders, and 2.6 million others eligible, will be able to come to Britain for five years. After a further year, they will be able to apply for citizenship.
"This is a special, bespoke, set of arrangements developed for the unique circumstances we face and in light of our historic commitment to the people of Hong Kong," Foreign Secretary Dominic Raab told parliament.
The US House of Representatives on Wednesday agreed unanimously to seek tough sanctions on Chinese officials and Hong Kong police.
US Secretary of State Mike Pompeo said China had broken its promise to the people of Hong Kong and President Donald Trump would look to punish it.
Mr Trump’s opponent in this year’s presidential election, Joe Biden, has blamed a "weak" Mr Trump for the new law and vowed a tougher stance on human rights if he wins the White House.
Additional reporting by AFP.