Boris Johnson has vowed to look “very carefully” at a controversial new national security law for Hong Kong which has been passed by China to see if it breaches a treaty between the UK and Beijing.

The Prime Minister said the Government was “deeply concerned” that the legislation – which would allow authorities to crack down on subversive and secessionist activity in the former British colony – had been passed.

Mr Johnson, answering questions following a major speech in the West Midlands, told reporters: “We are obviously deeply concerned about the decision to pass the national security law in Beijing as it affects Hong Kong.

“We will be looking at the law very carefully and we will want to scrutinise it properly to understand whether it is in conflict with the Joint Declaration between the UK and China. We will be setting out our response in due course.”

Asked whether it would impact on his decision to allow Huawei to be used in Britain’s 5G network, the PM said: “The position is very, very simple: I’m not going to get drawn into Sinophobia because I’m not a Sinophobe.

“But on the other hand I do want to see our critical national infrastructure properly protected from hostile state vendors, and so we need to strike that balance and that’s what we’ll do.”

Foreign Secretary Dominic Raab described China’s actions as a “grave” and “deeply troubling” step.

He said: “Despite the urging of the international community, Beijing has chosen not to step back from imposing this legislation. China has ignored its international obligations regarding Hong Kong. This is a grave step, which is deeply troubling.

“We urgently need to see the full legislation, and will use that to determine whether there has been a breach of the Joint Declaration and what further action the UK will take.”

Earlier, during Foreign Office questions in the Commons, Mr Raab urged China to “step back from the brink”.

“The success of Hong Kong, the entrepreneurial spirit, the vibrancy, the economic success, has been built on its autonomy in the one country, two systems paradigm.

“That clearly is at threat if China, as we now fear, has enacted the legislation and our worst fears in terms of the substantive detail are borne out.

“It would be bad news for all international businesses not just for the people of Hong Kong but for China.

“Which is why even at this stage we would urge China to step back from the brink, respect the rights of the people of Hong Kong and frankly live up to its international obligations through the joint declaration and to the international community.”

Shadow foreign secretary Lisa Nandy said he should not to “waver” on support for Hong Kong.

“(Mr Raab) told me in this House a few weeks ago that at its application Britain would act. That law comes into force tomorrow (Wednesday), he must not waver.”

And shadow foreign office minister Stephen Kinnock called on the Government to stop being “absent” when it comes to China.