China’s ambassador to the UK has fired an unmistakable warning shot in the direction of the defence secretary, Gavin Williamson, accusing him of “resurrecting the cold war and gunboat diplomacy”, after the cabinet minister said the UK would send an aircraft carrier to the Pacific to challenge China.

Writing in the Guardian, Liu Xiaoming did not name Williamson but accused “a certain British politician” of hyping up the “China threat”.

In a speech this month, Williamson announced that the aircraft carrier HMS Queen Elizabeth would be sent to the Pacific, where Beijing has been involved in a dispute over territorial claims in the South China Sea, for its first operational cruise, expected to be in 2021. He said the UK was prepared to use lethal force to deter countries that flouted international law, in an apparent reference to Chinese expansion.

In a clear response to Williamson, the Chinese ambassador writes: “In an age when hot and cold wars should be long gone, resurrecting the cold war and gunboat diplomacy from the grave, as this certain politician did, was anachronistic and risks disrupting the progress of China-UK relations.”

It is understood that a trade trip to China, due to be undertaken by the chancellor, Phillip Hammond, was cancelled in the wake of the offence caused by the Williamson speech.

The defence secretary’s remarks were also sharply criticised by George Osborne, the former chancellor and a firm advocate of a close British-China relationship. Osborne described the remarks as “gunboat diplomacy of a quite old-fashioned kind”.

There is a lively debate inside the UK government about whether the UK needs to take a more combative approach towards China, including at the United Nations and in Africa.

The Chinese ambassador sets out in his article the clear parameters of a future relationship, saying: “China and the UK must resist this disruption and keep the larger picture in mind.”

Calling for the two countries to act in harmony, he writes: “China and the UK rely on mutual respect and mutual trust to keep us in tune and keep out the noise of enmity and confrontation.”

Without mentioning Brexit, he also points out the potential price of disharmony for the UK, saying: “China is the fastest growing market for UK exports and the UK’s second largest trading partner outside the EU.”

He adds: “An open, innovative and inclusive UK is an internationally recognised brand name, and I hope that the UK will continue to provide a fair, transparent and non-discriminatory business environment for Chinese companies including Huawei. This will win more respect, trust and cheers for a ‘global Britain’.”

The US is leading a global campaign to keep the Chinese-owned firm Huawei out of the superfast 5G network, but so far UK intelligence chiefs have said the risk posed by the Chinese accessing the phone network is manageable.

Australia, New Zealand and the US – all close UK security partners – have decided to exclude Huawei, fearing China will use the access to conduct both industrial and political espionage. The National Cyber Security Centre said on Monday that it had “a unique oversight and understanding of Huawei engineering and cybersecurity”.

The ambassador also seeks to position China as an advocate of multilateralism, in unstated contrast to America. Urging the UK to “reject the chaotic disruption of rigidity and narrow-mindedness”, he claims: “Both China and the UK support multilateralism, free trade and rule-based international trade system. Both are permanent members of the UN security council and countries with global influence. We have a responsibility to oppose unilateralism and protectionism and build an open world economy.”

A Ministry of Defence source stressed that Williamson’s speech had been signed off by Downing Street and the Foreign Office, and he made no specific mention of the South China Sea in the speech, only to the Pacific.

Asked about the Chinese ambassador’s comments, Williamson said it was important to work with other nations in the region “in order to uphold international law”.

Additional reporting by Caroline Davies