China’s ambassador to London accused Britain on Monday of gross interference and making irresponsible remarks over Beijing’s imposition of new security legislation in Hong Kong that he said could damage future Chinese investment.

Britain has described the security law as a “clear and serious” violation of the 1984 Joint Declaration under which it handed back its colony to China 13 years later and said that London would offer around 3 million residents a path to British citizenship.

“The UK government keeps making irresponsible remarks on Hong Kong affairs,” Ambassador Liu Xiaoming told reporters in the strongest rebuke Beijing has issued to London since Britain criticised the security law.

On the British offer to give British National (Overseas) (BNO) passport holders in Hong Kong a path to British citizenship, he said: “This move constitutes gross interference in China’s internal affairs and openly tramples on the basic norms governing international relations.”

He said China would decide on its response after seeing how Britain proceeded with its passport offer.

Although Prime Minister Boris Johnson describes himself as a “Sinophile”, he has also spoken of the need to “stick up for our friends in Hong Kong”, straining relations with Beijing.

He has also toughened his language on a provisional decision to allow China’s Huawei to be involved in the development of Britain’s 5G infrastructure, saying he would protect critical infrastructure from “hostile state vendors”.

Johnson has faced intense pressure from the United States and some British lawmakers to ban the telecommunications equipment maker on security grounds and Britain’s media minister said on Monday the Huawei decision was not set in stone.

Liu said that, although China wanted friendly relations with Britain, there might be many consequences if Britain treated Beijing as an enemy or with suspicion.

“We want to be your friend. We want to be your partner. But if you want to make China a hostile country, you will have to bear the consequences,” he said.

He said a U-turn on its Huawei decision would damage Britain’s image as an open, business-friendly environment and it meant London was having to “bounce to the tune of the other countries”.

“The China business community are all watching how you handle Huawei. If you get rid of Huawei it sends out a very bad message to other Chinese businesses,” Liu said.

In 2015, former British prime minister David Cameron heralded a “golden era” in bilateral relations with Beijing but these have soured amid growing dissent in Hong Kong. Liu said he hoped it was not over but Britain had to be careful how it characterised China.

“Whether it is over or not is not up to the Chinese side,” he said. “We have every reason to have good relations with the UK.”

Hong Kong returned to China on July 1, 1997, under a “one country, two systems” formula guaranteeing wide-ranging autonomy and freedoms not enjoyed on the mainland, including an independent judiciary.