The stringent national security law and its 66 articles were kept secret from the public until 11pm local time, when the law officially went into effect. It dramatically broadens Beijing's powers to investigate, prosecute and punish suspected criminals in Hong Kong.
The law was drafted behind closed doors by members of Beijing's top lawmaking body, the National People's Congress (NPC), bypassing Hong Kong's own elected legislative council.
The new legislation criminalizes secession, subversion, terrorism, and collusion with foreign powers. People who are convicted of such crimes can face sentences up to life in prison.
Under the new law, the Chinese central government will establish its own law enforcement presence in Hong Kong, labeled the "Office for Safeguarding National Security." A secretive national security committee for Hong Kong will also be established, comprised of Hong Kong government officials and an advisor appointed by the Chinese central government. According to a summary published by the Hong Kong government, this group's work "shall not be disclosed to the public," and "decisions by the Committee shall not be amenable to judicial review."
Hong Kong's Chief Executive Carrie Lam said on Tuesday evening that she welcomed the introduction of the legislation.
"Safeguarding national security is the constitutional duty of the Hong Kong Special Administrative Region (HKSAR). The HKSAR Government welcomes the passage of the national security law by the NPCSC today," Lam said in a statement.
She repeated previous remarks, saying the law "seeks to practically and effectively prevent, curb and punish four types of crimes seriously endangering national security."
The chief executive said that dedicated units in the Hong Kong Police Force and the Department of Justice will be responsible for enforcing the legislation.
Lam added: "I am confident that after the implementation of the national security law, the social unrest which has troubled Hong Kong people for nearly a year will be eased and stability will be restored, thereby enabling Hong Kong to start anew, focus on economic development and improve people's livelihood."
In a video address to the United Nations Human Rights Council in Geneva earlier on Tuesday, Lam said the law will "have no retrospective effect" -- a major concern for many democracy activists in the city, especially for those facing charges relating to the protests last year.
Additionally Lam said that Hong Kong authorities would exercise jurisdiction over offenses under the law, "except in rare specified situations," suggesting that some cases would be tried in mainland China.
The new law specifies three circumstances which allow Beijing to exercise jurisdiction over Hong Kong, including in cases involving foreign forces, serious situations that the Hong Kong government cannot handle effectively, and when national security faces a major threat. Under the legislation, Hong Kong's Chief Executive now has the power to appoint judges to handle cases related to national security.
China's State Council Information Office said it would will hold a press briefing on the national security law in Beijing on Wednesday morning.
The legislation has been widely criticized by opposition lawmakers in Hong Kong, human rights groups and politicians worldwide, with many saying it will cement Beijing's direct control over the semi-autonomous city. Many worry it could be used to target political dissidents, activists, human rights lawyers and journalists amid the central government's continuing crackdown on civil society under Chinese President Xi Jinping.
Activists have vowed to demonstrate against the law on July 1, the anniversary of the territory's handover from British colonial rule to China in 1997. The day has become an annual day of protests in the city, but for the first time since handover police have not given permission to protesters to hold peaceful demonstrations.
"One country, two systems"
The law's passing is expected to fuel further anger and protests in the city, which was rocked by over six months of increasingly violent anti-government unrest last year.
Crucially, those freedoms include the right to assembly, a free press, and an independent judiciary, rights that are not enjoyed on the Chinese mainland.
Chinese Communist Party officials and state media have defended the law as vital to protecting national security in the wake of last year's protests and a 17-year failure by the Hong Kong government to pass similar legislation, since the last effort was met with mass protests in 2003.
In a statement last week, Lam said the law would ensure "the long-term prosperity and stability of Hong Kong," and that it would "only target an extremely small minority of people." She said the proposed bill was "in line with the rule of law" and the "rights and freedoms which are applicable in Hong Kong."
The new legislation grants police investigating crimes relating to national security the power to search properties, intercept information and perform covert surveillance without a warrant.
Under the law, the Hong Kong government, along with the new commission, will strengthen its regulations over foreign news agencies and Non-Government Organizations.
The bill also broadens the range of its application to non-permanent residents in Hong Kong. Those who are in violation of the law will be deported from Hong Kong, the law stated.
Ultimately, the legislation makes clear that national security law trumps local laws. If there is a conflict with existing Hong Kong law, the national security law will prevail.
Reaction from Hong Kong and around the world
Many in the city have decried the lack of transparency over the legislation. In a letter to the Hong Kong government, Philip Dykes, chairman of the Hong Kong Bar Association said the secrecy of the law was "genuinely extraordinary" and called on the government to make clear how citizens' minimum rights will be guaranteed.
Joshua Wong, an activist who helped lead massive pro-democracy protests in Hong Kong in 2014 said on Twitter that it "marks the end of Hong Kong that the world knew before."
He said Hong Kong "will continue to fight for our freedoms and democracy for the city's next generations. When justice fails, our fight goes on."
Following news of the legislation passing, Hong Kong democracy group Demosisto, which was formed as a political party by Wong in 2016, said it will "disband and cease all operation as a group given the circumstances."
It comes after Wong and other activist leaders, Nathan Law and Agnes Chow, said they would be withdrawing from Demosisto because of the threat posed by the law.
Wong and other activists have met with foreign diplomats and testified before the US Congress on Hong Kong's freedoms since the large-scale pro-democracy protests broke out last summer.
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."
"The democratic movement will have to adjust its strategy because it's a fact that a lot of the people in the democratic movement are scared -- either they find ways to leave or emigrate or to sidestep the movement." Lai, who was arrested in February in relation to a protest march, said he would stay in the city and "keep on fighting."
Rights group Amnesty International said the legislation "represents the greatest threat to human rights in the city's recent history."
"The speed and secrecy with which China has pushed through this legislation intensifies the fear that Beijing has calculatingly created a weapon of repression to be used against government critics, including people who are merely expressing their views or protesting peacefully," said the head of Amnesty International's China Team, Joshua Rosenzweig.
Taiwan's President Tsai Ing-wen said reports on China passing the security law "proves that 'one country, two systems' is not credible." Tsai said that Taiwan will start an office from July 1, which will "provide humanitarian aid for our friends in Hong Kong."
In Japan, Chief Cabinet Secretary Yoshihide Suga called the passing of the law "regrettable."
On Monday, US Secretary of State Mike Pompeo announced an end to the exports of US-origin defense equipment and dual-use technologies to Hong Kong. Pompeo said the move was necessary to protect American national security as the tensions between the US and China continue to escalate.
"As Beijing moves forward with passing the national security law ... We can no longer distinguish between the export of controlled items to Hong Kong or to mainland China," Pompeo said.
This is the first action the US government has taken to upend the special status trade relationship between the US and Hong Kong, following the determination that Hong Kong was no longer autonomous from China due to Beijing imposing the national security law on the city.
It comes as Beijing on Monday said it would impose visa restrictions on certain Americans in response to Washington's move last week to place similar limits on Chinese officials over Hong Kong.
"Beijing's so-called 'national security' law -- passed on the eve of the 23rd anniversary of the handover of Hong Kong from the United Kingdom to China -- signals the death of the 'one country, two systems' principle," Nancy Pelosi, the Speaker of the US House of Representatives, said in a statement Tuesday.
"We continue to urge President Trump to hold Chinese officials accountable for their abuses including in Hong Kong."
"We must consider all tools available, including visa limitations and economic penalties."
The UK also expressed concern over the new law.
UK Foreign Secretary Dominic Raab signaled Tuesday that Britain would uphold its promise to provide a path to British citizenship for potentially millions of Hong Kongers if the details of the law are as expected.
"We are, obviously, deeply concerned about the decisions to pass the national security law in Beijing as it affects Hong Kong," UK Prime Minister Boris Johnson said Tuesday.
"We will be looking at the law very carefully, will want to scrutinize it properly to understand whether it is in conflict with the joint declaration between the UK and China, and we will be setting out our response in due course."
CNN's James Griffiths, Steven Jiang, Jadyn Sham, Eric Cheung, Isaac Yee, Nectar Gan, and Jessie Yeung contributed to reporting and writing.