The UK could offer British National (Overseas) passport holders in Hong Kong a path to citizenship if China does not suspend plans for a security law in the territory, Foreign Secretary Dominic Raab says.
The law, making it a crime to undermine Beijing's authority, prompted fears Hong Kong's unique status could end.
China said it reserved the right to take "counter-measures" against the UK.
There are 2.9m people in Hong Kong eligible for the passport.
Foreign ministry spokesman Zhao Lijian said the UK and China had agreed that holders of British National (Overseas) - or BNO - passports 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 already have the right to visit the UK for up to six months without a visa.
But the Home Office confirmed that the proposed new rights, allowing those eligible to spend 12 months in the UK without a visa, could be offered to anyone with BNO status as long as they applied for and were granted the passport - opening it up to 2.9m Hong Kong residents.
Home Secretary Priti Patel said she was "deeply concerned" at China's proposals for legislation related to national security in Hong Kong.
In a statement, she said: "If China imposes this law, we will explore options to allow British Nationals Overseas to apply for leave to stay in the UK, including a path to citizenship.
"We will continue to defend the rights and freedoms of the people of Hong Kong."
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.
It comes as US President Donald Trump described the Chinese government's plans in Hong Kong as a "tragedy", and announced he would start to end preferential US treatment for the city in trade and travel.
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".
What did Raab say?
British National (Overseas) passports were issued to people in Hong Kong by the UK before the transfer of the territory to Chinese sovereignty in 1997.
Announcing the possible change in policy, Mr Raab said the six-month limit on stays in the UK for BNO holders would be scrapped.
"If China continues down this path and implements this national security legislation, we will remove that six month limit and allow those BNO passport holders to come to the UK and to apply to work and study for extendable periods of 12 months and that will itself provide a pathway to future citizenship," he said.
The BBC's diplomatic correspondent James Landale says that Beijing might not mind if some pro-democracy campaigners escape to the UK, but the flight of talented wealth creators would be of concern.
Some MPs want the UK to go further and offer automatic citizenship. Conservative MP Tom Tugendhat, chairman of the foreign affairs select committee, said BNO holders should have an automatic right to live and work in the UK.
The government has in the past rejected calls to give BNO holders in Hong Kong full citizenship.
Last year more than 100,000 people in Hong Kong signed a petition calling for full rights. The government responded by saying that only UK citizens and certain Commonwealth citizens had the right of abode in the UK and cited a 2007 review which said giving BNO holders full citizenship would be a breach of the agreement under which the UK handed Hong Kong back to China.
However in 1972 the UK offered asylum to some 30,000 Ugandan Asians with British Overseas passports after the then-military ruler Idi Amin ordered about 60,000 Asians to leave. At the time some MPs said India should take responsibility for the refugees, but Prime Minister Edward Heath said the UK had a duty to accept them.
What other reaction has there been?
Shadow Foreign Secretary Lisa Nandy earlier said the UK had to be more robust with Beijing.
Referring to the security law, she told the BBC: "This is the latest in a series of attempts by China to start to erode the joint declaration which Britain co-signed with the Chinese government when we handed over Hong Kong, and protected its special status."
"We want to see the UK government really step up now," she said.
Former Foreign Secretary Jeremy Hunt said the UK should bring together a coalition of countries to avoid a tragedy in the territory.
He told the BBC: "This is definitely the most dangerous period there has ever been in terms of that agreement.
"With our unique legal situation, Britain does have a responsibility now to pull together that international coalition and to do what we can to protect the people of Hong Kong."
On Thursday Prime Minister Boris Johnson
's official spokesman told a Westminster briefing: "We are deeply concerned about China's legislation related to national security in Hong Kong.
"We have been very clear that the security legislation risks undermining the principle of one country, two systems.
"We are in close contact with our international partners on this and the Foreign Secretary spoke to US Secretary [Mike] Pompeo last night."
He added: "The steps taken by the Chinese government place the Joint Declaration under direct threat and do undermine Hong Kong's high degree of autonomy."
On Wednesday, Mr Pompeo said developments in Hong Kong meant it could no longer be considered to have "a high degree of autonomy" from mainland China.
This could lead to Hong Kong being treated the same as mainland China under US law, which would have major implications for its trade hub status.