When presidents embark on prestigious state visits abroad, in the past they were expected to leave their political disputes at home and put on a friendly face for the nation hosting them.

But when President Trump arrived in London on Monday for a long-delayed state visit to Britain, he ignored both customs. Circling back to a long feud with Sadiq Khan, London’s first Muslim mayor and a vocal critic of Trump, the president tweeted: “@SadiqKhan, who by all accounts has done a terrible job as Mayor of London, has been foolishly ‘nasty’ to the visiting President of the United States, by far the most important ally of the United Kingdom.

“He is a stone cold loser who should focus on crime in London, not me,” Trump wrote, before casually adding a stab at another U.S. critic, NYC Mayor Bill de Blasio (“dumb and incompetent"), and shaming Khan for being “only half his height.”

As mayor of London, Khan governs a city that is about as populous as Switzerland — but still, he remains a locally elected official with limited sway over policies. How did he make it into the top category of Trump’s favorite foreign foes, who has been more consistently mocked and derided by the president than other foreign politicians, including North Korean dictator Kim Jong Un?

Khan, his own supporters say, has managed to hit the president where it hurts most, by winning election in a liberal and diverse city on promises that go against Trump’s core policies, granting permission for a “Trump baby” balloon to fly over the skies of London during Trump’s work visit there last year and deploying his own biography to try to prove Trump wrong.

To Khan, a former human rights lawyer, the feud is personal. The son of a bus driver became mayor in 2016, one year after Trump first called for a “total and complete shutdown of Muslims entering the United States until our country’s representatives can figure out what is going on,” after the November 2015 Paris attacks.

Before Khan was elected mayor, he told The Washington Post’s Karla Adam that Trump was seeking “to divide communities rather than unite them.” Khan repeatedly said in jest that his Muslim faith could pose problems during future U.S. visits.

“I’ll need to rush to come to America before November, because if Trump wins, I’ll be banned from coming,” Khan told The Post.

After becoming mayor, Khan, a Hillary Clinton supporter, doubled down, telling the BBC, “Donald Trump’s ignorant view of Islam could make both our countries less safe: It risks alienating mainstream Muslims around the world and plays into the hands of the extremists.”

Tying Trump’s rhetoric to extremism hit a nerve, as Khan later found out when his own city was struck by a terrorist attack.

Queen Elizabeth II and Prince Charles attended an official welcome ceremony for President Trump and first lady Melania Trump at Buckingham Palace on June 3. (The Washington Post)

The criticism did not go unnoticed in the White House at the time, even though Trump initially wished the new mayor luck, telling the New York Times that “there will always be exceptions” to his proposed travel ban — a response that appeared to prove how serious he was about his plans.

“If he does a good job, and frankly if he does a great job, that would be a terrific thing,” Trump said.

But soon after, both traded insults.

On “Good Morning Britain,” a breakfast TV show, Trump called Khan “ignorant,” adding that “he doesn’t know me, never met me, doesn’t know what I’m all about,” he said.

“Frankly, tell him I will remember those statements,” Trump said.

And he did.

After Trump won the U.S. elections, British Prime Minister Theresa May was the first world leader to invite him on a rare state visit. Khan was not amused, calling the invitation “inappropriate.”

“I think this ban on people from seven Muslim-majority countries, ending the refugee program is cruel, and it’s shameful. In those circumstances, we shouldn’t be rolling out the red carpet,” Khan said.

When eight people were killed in a terrorist attack at London Bridge on June 3, 2017, Khan urged for a calm response.

“There’s no reason to be alarmed,” Khan told Londoners.

On Twitter, Trump lashed out at Khan over those remarks, writing: “At least 7 dead and 48 wounded in terrorist attack and Mayor of London says there is ‘no reason to be alarmed!’ ”

At the time, Khan’s spokesman shrugged off the remarks, saying Khan “has more important things to do than respond to Donald Trump’s ill-informed tweet that deliberately takes out of context his remarks urging Londoners not to be alarmed when they saw more police — including armed officers — on the streets.”

Simply ignoring Trump is more difficult, however, when he’s on a state visit in your own city.

Both politicians may also see their public Twitter and TV spats as an opportunity to rally their base: Both are facing low approval ratings. Khan’s popularity has recently dipped after knife crime went up in the city and a key infrastructure project was delayed.

Ahead of the trip, Khan upped the stakes when he compared Trump’s rhetoric to that used by “fascists of the 20th century.”

“Donald Trump is just one of the most egregious examples of a growing global threat,” Khan wrote in the Observer newspaper. It was likely this article that prompted Trump’s derogatory tweets on arrival.

Khan later posted a video on his Twitter account, calling on Trump to respect the rights of women.

“President Trump, if you’re watching this, your values and what you stand for are the complete opposite of London’s values and the values in this country,” Khan said.

“We think diversity is not a weakness. Diversity is a strength. We respect women. And we think they’re equal to men,” he said.

Trump has yet to respond to that particular message from Khan.

Read more: