Foreign Secretary Liz Truss has issued a warning to China that any attempt to invade Taiwan would be a “catastrophic miscalculation”.

Speaking at the Nato summit in Madrid, Ms Truss said Beijing was in danger of making the same mistake that Russian President Vladimir Putin made in Ukraine.

She reiterated her call for Western allies to arm the self-governing island – which China has long claimed – to ensure it has the means to defend itself in the event of an attack.

“We’ve seen increased collaboration between Russia and China and we know that China is watching Ukraine closely,” she said.

“I do think that with China extending its influence through economic coercion and building a capable military there is a real risk that they draw the wrong idea that results in a catastrophic miscalculation such as invading Taiwan,” she said.

“That is exactly what we saw in the case of Ukraine – a strategic miscalculation by Putin. That is why it is important that the free world work together to help ensure that Taiwan is able to defend itself and stress the importance of peace and stability across the Taiwan Strait.”

Taiwan has been self-governing since nationalist forces fled there in 1949 after the communists took control of China, and is considered to be a rebel province by Beijing.

Ms Truss said it was “very worrying” that China has recently backed Argentina’s claims to sovereignty over the Falkland Islands as well making comments about Nato.

She said that Western nations needed to develop economic alternatives to China to ensure they do not become dependent on it in the way some countries are on Russian oil and gas.

“This isn’t just about hard security. It is about economic security,” she said.

“I think the lesson we have learned from the Ukraine crisis is the increased dependency of Europe on Russian oil and gas contributed to a sense in which Russia felt enabled to invade Ukraine.

“We also need to learn that lesson, I believe, with China of not becoming strategically dependent on China and in fact making sure that we have strong alternatives.

“I think there are huge lessons that we can learn and we need to learn them as soon as possible.”