China said Thursday it will consider not recognizing Hong Kong residents’ British National (Overseas) passports as valid travel documents, calling Britain’s visa offer to millions of Hong Kong people a violation of international law.

China was threatening a countermeasure after Britain revealed Wednesday details of a visa program for an estimated 2.9 million Hong Kong people who hold or are eligible for BNO passports, and their dependent children, to live in the country and apply for citizenship.

Britain’s measure itself was in response to China’s recent imposition of a sweeping national security law on Hong Kong, which has sparked concerns about an erosion of human rights and freedoms in the former British colony.

At a press conference in Beijing on Thursday, Foreign Ministry spokesman Wang Wenbin accused Britain of breaking promises over its visa offer, adding the country also violated international laws and the principles of international relations over the passport issue.

“Since Britain broke its promises first, China will consider not recognizing the British Nationals (Overseas) passports as valid travel documents, and we reserve the right to take further necessary measures,” Wang said.

Under Britain’s visa program, effective from January 2021, Hong Kong people who hold or are eligible to have the passports will be able to stay in the country for a total of five years to work or study but without access to welfare services.

Afterward, they can apply to stay in Britain for another year and apply for citizenship.

The passports have been issued to those who were born in Hong Kong before its return to Chinese rule in 1997.

“The United Kingdom has explicitly pledged that BNO passport holders who are Chinese citizens residing in Hong Kong shall not have the right of abode in the U.K.,” a spokesperson at the Chinese Embassy in London said in a statement earlier Thursday.

“The U.K. has now, in total disregard of the strong opposition and repeated representations of the Chinese side, offered a route for BNO passport holders to the right of abode and application for citizenship in the U.K.”

“This seriously goes against its own promises, interfered in China’s internal affairs, and violated international law and the basic norms governing international relations,” the spokesperson said, vowing that China will take “effective countermeasures.”

China’s security law and “its strict implementation constitutes a clear breach of the 1984 Sino-British Joint Declaration, undermining the ‘one country, two systems’ framework,” British Home Secretary Priti Patel said in a statement to Parliament on Wednesday.

“Now that China, through its actions, has changed the circumstances that BNO citizens find themselves in, it is right that we should change the entitlements which are attached to BNO status,” she said.

“I have decided to significantly improve those entitlements, to reassure BNO citizens that they have options to live in the U.K. if they decide that is an appropriate choice for them.”

Over the national security legislation, Britain has also suspended its extradition treaty with Hong Kong and extended to Hong Kong an arms embargo that has applied to China since 1989.

The law, enacted by Beijing and imposed on Hong Kong at the end of last month, outlaws what it defines as acts of secession, subversion, terrorism and collusion with foreign forces. It also allows suspects to be transferred to mainland China for prosecution.