The UK could offer British National (Overseas) passport holders in Hong Kong a path to UK citizenship if China does not suspend plans for a security law in the territory, UK Foreign Secretary Dominic Raab says.
It comes after China's parliament backed proposal that would make it a crime to undermine Beijing's authority.
There are fears the legislation could end Hong Kong's unique status.
China said it reserved the right to take "countermeasures" against the UK.
Foreign ministry spokesman Zhao Lijian said the UK and China had agreed that holders of British National (Overseas) - or BNO - passport should not enjoy UK residency.
"All such BNO passport holders are Chinese nationals and if the UK insists on changing this practice it will not only violate its own stance but also international law," he added.
There are 300,000 BNO passport holders in Hong Kong who have the right to visit the UK for up to six months without a visa.
Mr Raab's statement came after the UK, US, Australia and Canada issued joint condemnation of Beijing's plan, saying imposing the security law would undermine the "one country, two systems" framework agreed before Hong Kong was handed over from British to Chinese rule in 1997.
The framework guaranteed Hong Kong some autonomy and afforded rights and freedoms that do not exist in mainland China.
China has rejected foreign criticism of the proposed law, which could be in force as early as the end of June.
Li Zhanshu, chairman of the parliamentary committee that will now draft the law, said it was "in line with the fundamental interests of all Chinese people, including Hong Kong compatriots".