Article 23 of the Basic Law states: Similar laws had been in force during the British colonial period, but they had not been strictly enforced since 1945. The Emergency Regulations Ordinance from the colonial period remains in force, but in 2019 the Court of First Instance ruled that it was "not compatible with the constitutional order laid down by the Basic Law" due to its unchecked and wide scope. The Court of Appeal later varied this by permitting the Prohibition on Face Covering Regulation as reasonable and valid, but stated ERO regulations were "subject to judicial scrutiny." Before 1997, the British colonial government introduced the Crimes Bill 1996 in an attempt to concretise the concepts of "subversion" and "secession" by confining them to actual violent conduct but of no avail. The bill was voted down in the elected Legislative Council of Hong Kong amid opposition from Beijing and thus left a vacuum in the present legislation.
There were calls for reintroducing the national security bill after the 2003 setbacks from the pro-Beijing camp occasionally. After the Beijing interpretation of the Basic Law in November 2016 over the Legislative Council oath-taking controversy to eject two pro-independence legislators from the legislature on the basis that " will absolutely neither permit anyone advocating secession in Hong Kong nor allow any pro-independence activists to enter a government institution," Chief executive Leung Chun-ying said Hong Kong would enact Article 23 targeting the pro-independence movement in Hong Kong. The Director of the Liaison Office of the Central People's Government in Hong KongWang Zhimin accused pro-independence activists of "engaging in activities that sought to separate the motherland and subvert the national regime" and urged the Hong Kong government to enact national security legislation as he said "Hong Kong is the only place in the world without a national security legislation – it’s a major weakness in the nation’s overall security, and it has a direct impact on residents." Wang said without a national security law, "Hong Kong independence radicals have been challenging national sovereignty and security in recent years".
Protests in 2019 and imposition of security law in 2020
The 2019–20 Hong Kong protests led to an increasing desire within some pro-Beijing lawmakers for Hong Kong to legislate Article 23 of the Basic Law. On 21 May 2020, the Chinese Government proposed a new law on national security regulations that may be enacted in Hong Kong under the provisions of Annex III of its Basic law. It may set up the legal framework to prevent and punish subversion, terrorism, separatism and foreign interference. The following day, a dozen pan-democrat lawmakers marched to the Chinese Liaison Office to show their disapproval. On 30 June 2020 the mainland 13th National People's Congress and Standing Committee of the National People's Congress imposed a partially equivalent security law on Hong Kong covering secession and subversion under Article 18 of the Basic Law. The areas of treason, sedition and theft of state secrets are not covered by the new Article 18 law, and remain to be implemented under Article 23 by the Hong Kong SAR.