As he flew into London for an official visit earlier this month, there was a moment when the president of the United States looked down and decided that the most pressing thing he had to do was tweet that Sadiq Khan, mayor of the city that was about to host him, was a "stone cold loser".
Those words started the latest round in a long-running spat – dispute is too lofty a word – between the two men. The row sank to a new low this week when, following a series of murders in London, Mr Trump retweeted a post by the far-right commentator Katie Hopkins that referred to the UK capital as "stab-city" and castigated Mr Khan.
If it seems bizarre that the most powerful politician in the western world would focus so relentlessly on the performance of the mayor of a city thousands of miles across the Atlantic while urban centres in his own country experience myriad problems, it is useful to remember that in Mr Trump the personal and the political merge. Attacking Mr Khan is not merely an ugly habit – it is good politics.
Mr Trump is obsessed with Mr Khan because it plays well with the wilder fringes of his base. Mr Trump's attacks function as the reflection of the collective imagination of a movement for which he, as Mr Khan put it, is the “poster boy”.
The key to understanding Mr Trump’s preoccupation with the Muslim mayor of Europe's largest city can be found in one word of Hopkins’ tweet: “Londonistan”.
The use and significance of this heavily loaded portmanteau has evolved over the past 20 years. According to some reports, it was coined by French intelligence officials in the 1990s, in reference to a number militant of Islamist groups operating in the city.
Since 9/11, however, it has taken on a broader and arguably darker meaning, fuelled by Islamophobia and the wilder fringes of online conspiracy theory.
For the far right, Londonistan is the representation of all that has gone wrong in western culture: an imaginary dystopia filled with refugees and minorities, beholden to sharia law that is enforced by a Muslim caliph.
In their telling, the West is collapsing, not merely by an influx of Muslim migrants, but also by an enfeebled, self-hating European elite that is ashamed of its heritage and eager to be “replaced”.
Those ideas have infected the nation’s political discourse at multiple levels, from the campaign to “take back control” from the European Union to the violent actions and rhetoric of the far right.
It should be no surprise that Leave.eu, the unofficial yet extremely influential campaign group pushing for Britain to exit the European Union, once tweeted that “Londonistan [was] built on the sad ruins of English Christianity”.
The same themes can be detected in the manifesto of the Norwegian terrorist Anders Breivik and the claim, just last month, by Italy's deputy prime minister Matteo Salvini that only votes for nationalist parties can save “our children” from “an Islamic caliphate with sharia law in our cities”.
It unites the men in suits who speak on TV panels and those who sit in basements posting on online messageboards, the politics of the bullet and the ballot box.
Mr Khan has become the focus of this hate by virtue of his success. He is arguably the most powerful Muslim politician in Europe, even though the mayor's powers are actually rather limited, thanks to his public profile. Unforgivably for the far right, he is a practising Muslim, standing for a centre-left party, who happily describes himself as a feminist, and has campaigned for the UK to step up its commitment to refugees.
He is attacked online in the most graphic, racist language imaginable and now has to live under 24-hour police protection.
All of which brings us to Mr Trump.
The post that Mr Trump retweeted, which linked the violent deaths of young people with “Khan's Londonistan”, is part of a drip-feed of insinuations and half-truths meant to suggest that Muslim leadership of the city has turned it into a war zone.
One of the conundrums of Mr Trump’s presidency is that, while he is undeniably a “gut politician”, who says and does things on instinct, he understands his base well. Attacking Mr Khan is good politics, positioning him as a president willing to tell “hard truths” and keep minorities in their place. Such ugly sentiments play well in a divided political world.
For Mr Trump, the notoriety that comes with such positions brings big political rewards. But Mr Khan has used Mr Trump's attacks to position himself as the man willing to stand up to Mr Trump while the rest of the political class normalises and tolerates his behaviour.
He was able, for example, to say publicly that Mr Trump should not be feted on his state visit and allowing an unflattering Baby Trump balloon to be flown over the city. All of this plays well in a city in which tens of thousands of protestors massed against the US president's visit this month.
Behind Mr Trump's ugly obsession with the mayor lies a hinterland of hateful politics. Mr Khan’s smartest move has been to turn it to his advantage.