Theresa May has failed to stand up to Donald Trump for political or moral reasons, but she must now do so for security ones. The US president is up and out of bed and playing with his phone, as per usual. What makes today different to other days is that he is actively working to make a security situation in London worse. He is attacking the capital's mayor as he responds to a terrorist atrocity. This requires a firm rejection by Downing Street or it will show that foreign leaders may act in a way which can destabilise Britain with impunity.

Trump's first attack on Sadiq Khan came at midday yesterday. He took a quote from the mayor out of context about there being no reason to be alarmed in the wake of the London Bridge attacks.

His second tweet came this afternoon, again targeted at Khan, this time accusing him of making excuses. In fact, Khan had simply referred back to his original statement that Trump had misquoted.

There are, of course, plenty of worries which could to be raised here. The relentless focus on Khan suggests that Trump's evident hatred of the mayor is motivated by Islamophobia – he is, after all, predominantly tweeting in support of his own Muslim travel ban to the US. It is also well below the level of national friendship one would expect from a US president for him to be publicly criticising any British official in the wake of a terrorist atrocity, much less the elected mayor of the very city which has been attacked. 

But put all that to one side for a moment. The real worry is the security implication.

The first task of city authorities in the wake of a terror attack is to hunt down the terrorists and those who have helped them. The second is to restore and maintain calm. In the case of London this has not been difficult. London is resilient. It does not scare easily. It feels pretty much the same today as it does on any other day. But that is never a guarantee. The public mood can turn suddenly. Britain's cities are witnessing a sustained series of attacks which are unlike any we have seen before. It resembles a guerilla campaign. The end point of that campaign is the creation of mass panic. 

Terrorism is scary. It takes place in locations you recognise. I have countless memories of those streets around London Bridge – of drinks in the George after work, of trying to handle those enormous beer mugs they give you at Katzenjammers, of looking out at the Winchester Geese cemetery when I'm tipsy, of sizing up cheese in Borough Market, of drinking wine with old friends in the Boot and Flogger. The attack is designed to replace those warm thoughts with the cold ones of murderers. It wants to make us feel unsafe where we are used to being safe, to feel fear where we felt friendship.

That feels personal, but it is not. It is intended to be system wide. It is intended to unsettle you so that every bang, every loud noise, every siren, make you feel like you could be in personal danger. It is intended to trigger mass panic, sudden rushes of people fleeing imaginary violence. It is intended to make you feel like the system is falling apart.

The terrorists want to scare us. It is a core part of the strategy. That's why the civic response is important and is emphasised by local and national government. It is a victory against terror and thereby discourages further terror. Not only that, but by trying to calm tempers it discourages any retaliatory violence. 

Trump's tweets are a direct attempt to hinder the capital's civic authorities from maintaining calm in the wake of a terror attack. They emphasise chaos over stability. They are therefore against the British national interest. This almost certainly isn't his intention. In all likelihood he is motivated simply by a racist hatred of the mayor. But it doesn't matter. The possible effect is what counts. 

The severity of this infringement requires a firm response from the prime minister. Earlier today she went further in her criticism of Trump than she had before – branding him "wrong" on climate change and expressing her support for Khan – but that is nowhere near enough. Basic patriotic decency requires that she now condemn Trump's comments. And basic security considerations demand that she show other world leaders that we will not tolerate this type of self-interested, irresponsible interference in the wake of a terror attack. To do otherwise sends a clear message to the world that Britain's prime minister will not stand up for its interests.

One more thing: That state visit must be cancelled immediately. He is not fit to receive the honour.

Ian Dunt is the editor of His book – Brexit: What The Hell Happens Now? – is available now from Canbury Press.

The opinions in's Comment and Analysis section are those of the author and are no reflection of the views of the website or its owners.