Image copyright AFPImage caption Hong Kong's pro-democracy movement lead waves of protests last year
China has passed a controversial security law giving it new powers over Hong Kong, deepening fears for the city's freedoms, the BBC has learned.
Last month China announced it would impose the law, which criminalises any act of secession, subversion, terrorism or collusion with foreign forces.
The move comes after angry protests last year - sparked by another law - which became a pro-democracy movement.
Critics say the new law poses an even greater threat to Hong Kong's identity.
They warn it will undermine Hong Kong's judicial independence and destroy the city's freedoms, which are not available in mainland China.
Hong Kong was handed back to China from British control in 1997, but with a unique agreement which guaranteed certain freedoms.
The bill has sparked demonstrations in Hong Kong and drawn international condemnation since it was announced by Beijing in May.
But China says the law is needed to tackle separatist activity, subversion, terrorism and collusion with foreign elements - and rejects criticism as interference in its affairs.
Image copyright AFPImage caption Critics warn the law will shut down dissent
The security law was fast-tracked to come into effect before Wednesday, which marks the anniversary of the handover from Britain to China and is usually marked by large-scale political protests.
It was passed unanimously on Tuesday morning by the Standing Committee of the National People's Congress in Beijing and is expected to be added to Hong Kong's Basic Law later in the day.
One of the city's most prominent activists, Joshua Wong, reacted by saying he would quit the pro-democracy group Demosisto he spearheaded until now.
Fellow activists Nathan Law and Agnes Chow also said they'd quit the group.
China has not officially confirmed the law has been passed, and the text of the bill has also not been made public, but some details have emerged.
It would make criminal any act of secession, subversion of the central government, terrorism and collusion with foreign or external forces.
A new national security office in Hong Kong would deal with national security cases, but would also have other powers such as overseeing education about national security in Hong Kong schools.
The Hong Kong government will be required to carry out most enforcement under the new law, but Beijing will be able to overrule the Hong Kong authorities in some cases.