China’s ambassador to the UK has accused British politicians of exhibiting a “colonial mindset” when they express support for demonstrators in Hong Kong or raise concerns about Huawei or freedom of navigation in the South China Sea.

Liu Xiaoming said British MPs were free to express their opinion about the Hong Kong crisis but needed to recognise there were limits. Critical comments were not a problem “as long as you do not interfere in Hong Kong’s affairs,” he said.

At the same briefing, China’s military attache in the UK, Maj Gen Su Guanghui, said the Royal Navy’s Queen Elizabeth aircraft carrier or any other British warship could face an armed response if it sailed through disputed waters in the South China Sea.

Liu said some UK politicians “still have a colonial mindset” and argued it was a problem if they made “irresponsible remarks to show support” for what he described as “demonstrators and rioters” in Hong Kong.

Statements that have irked the Chinese include a suggestion by Tom Tugendhat, the chair of the foreign affairs select committee, that Hong Kong citizens who hold British nationals (overseas) passports could be allowed to live and work in the UK.

Responding to the Chinese officials’ remarks, a UK government spokesperson said Britain was committed to asserting the rights of freedom of navigation. “The UK has enduring interests in the region and is committed to maintaining regional security. The presence of international navies in the South China Sea is normal and the Royal Navy is no exception to this.”

Hong Kong continues to be gripped by the worst crisis since the territory was handed over by Britain to China in 1997. Protests that began against a now abandoned extradition bill have morphed into calls for greater democracy.

The ambassador said China had not ruled out sending in its forces – who have been seen exercising near the border – to quell the unrest if Hong Kong’s administration could not maintain control of the territory in the future.

“If the riots become uncontrollable for Hong Kong SAR [special administrative region] government, China cannot sit on its hands and watch. Hong Kong is part of China. We can’t watch this violence go on and on,” Liu said.

Chinese officials are sceptical that the UK would want to grant Hong Kong citizens the right to move to the UK because of the numbers involved. Around 3 million people held British national (overseas) (BNO) passports at the time of handover in 1997, which grant the bearers the right to visa-free travel to the UK but no rights of residency.

The numbers of BNO passport holders has dropped since through the passage of time and lack of renewals, although anybody who once held a BNO passport before 1997 can get a new one. But diplomatic sources argue that given Britain voted to leave the European Union amid concerns about levels of immigration, the prospect of large numbers of arrivals from Hong Kong would probably be domestically unpopular.

At the briefing the officials also issued a warning that they did not want a repeat of an incident in November in which the HMS Albion sailed close to the disputed Paracel islands in the South China Sea and was accused by China of entering its territorial waters – a claim rejected by the UK.

Su indicated there would be a military response if a British warship sailed into its China’s waters. “If the US and UK join hands in a challenge or violated the sovereignty and territorial integrity of China, that would be hostile action,” he said.

In February the then defence secretary, Gavin Williamson, irritated Beijing when he suggested the UK’s new aircraft carrier, the Queen Elizabeth, would visit the South China Sea in its maiden voyage in around 2021.

China cancelled a trade meeting with Philip Hammond, then chancellor, and Theresa May was forced to distance herself from Williamson’s remarks. Downing Street said it would be for the prime minister to decide where the flagship would be deployed.

Liu said on Monday: “The South China Sea is a vast ocean, it is 3 million sq km wide, we have no objection to people sailing around there but do not enter Chinese territorial waters within 12 nautical miles. If you don’t do that, there shouldn’t be a problem.”

Liu also said that if the UK decided to ban Huawei from supplying technology for its 5G mobile network, as requested by the US on security grounds, Britain would face economic consequences.

“If the UK shuts the door on Huawei, you will lag a year and a half behind. It will send a bad message to Chinese business. The UK is regarded as open and business-friendly. But this would damage the UK’s image and harm business relations. It would look as though you are not open,” he said.

• This article was amended on 10 September 2019. An earlier version said that about 3 million people hold British national (overseas) (BNO) passports, and that a greater number could be eligible to claim the passports. In fact about 3 million people held BNO passports at the time of handover in 1997, and the number of BNO passport holders has dropped since, although anybody who once held a BNO passport before 1997 can get a new one.