A war of words has broken out between the UK and China over the situation in Hong Kong after Boris Johnson hit out at Beijing over its proposed national security law.

Zhao Lijian, the Chinese foreign ministry spokesman, accused Britain of a "Cold War mindset" and "colonial mentality" over its approach to Hong Kong.

He reiterated Bejing's stance that the agreement with the UK over the future of Hong Kong - the Sino-British Joint Declaration - was essentially null and void.

But Downing Street insisted the treaty, which was designed to smooth the transition from British rule in 1997 and guarantee a degree of autonomy, remained in force.

It said the national security legislation expected to be imposed by Beijing was in "direct conflict" with the agreement.

The Prime Minister used an article in the Times and Hong Kong's South China Morning Post to restate the UK's offer to allow almost three million of the region's inhabitants the opportunity to come to Britain if Beijing imposed the national security law.

He said the measure would curtail Hong Kong's freedoms and "dramatically erode its autonomy".

"If China proceeds, this would be in direct conflict with its obligations under the joint declaration, a legally binding treaty registered with the United Nations," he warned.

Downing Street was unable to say how many Hongkongers it expected would come to the UK under the new system, which would only be introduced if Beijing continued on its current path.

If China chooses to go ahead with its changes for the island, the PM said he would effectively upgrade the status of British National Overseas passports, which 350,000 people in Hong Kong hold and 2.5 million are eligible to apply for, to grant immigration rights beyond the current six-month limit.

"This would amount to one of the biggest changes in our visa system in British history," declared Mr Johnson, adding: "Many people in Hong Kong fear their way of life, which China pledged to uphold, is under threat.

"If China proceeds to justify their fears, then Britain could not in good conscience shrug our shoulders and walk away; instead we will honour our obligations and provide an alternative."

However, Mr Zhao responded by saying: "The UK has no sovereignty, no jurisdiction and no right to supervise Hong Kong.

"As such, on no ground can it cite the Joint Declaration to arbitrarily comment on Hong Kong affairs or interfere in China's domestic affairs."

But Lord Patten, the last British Governor of Hong Kong, called for the Government to take a tougher line with Beijing.

He told peers: "If China cannot keep their word with Hong Kong, when will they keep their word? What is honourable is at the same time what is in the nation's interest.

"We must stand up to China's bullying. We need to be more independent from a power whose leaders regard our fundamental principles with hostility."

Alistair Carmichael for the Liberal Democrats said all Hong Kongers should be given the right to live in the UK.

"China's Foreign Ministry are being wilfully ignorant. The Sino-British Joint Declaration was not a unilateral announcement but a clear joint legal text, lodged at the UN. The clue is in the name,” insisted the party’s foreign affairs spokesman.

"Both the UK and China made promises to the people of Hong Kong during the Handover. Under the Joint Declaration, Hong Kong's 'one country, two systems' way of life was to be protected and enhanced.

"Beijing has shown increasing contempt for the Joint Declaration and it is clear that the Government must now ensure all Hong Kongers are given the right to live in the UK. Liberal Democrats will continue to urge the UK Government to expand the BNO offer they have outlined," added the Orkney and Shetland MP.

The measure passed by China's National People's Congress will alter the territory's mini-constitution, or Basic Law, to require its government to enforce measures to be decided later by Chinese leaders.

Critics claim the law erodes the "one country, two systems" framework that promised Hong Kong freedoms not found in mainland China for 50 years.

Protesters have taken to the streets in Hong Kong to demonstrate, despite coronavirus social distancing restrictions still being in place.