Donald Trump’s state visit to the United Kingdom will not be cancelled, Prime Minister Theresa May said on Tuesday, despite outrage across the political spectrum over the American president’s false accusation that the mayor of London, Sadiq Khan, had downplayed the deadly terrorist attack in the city on Saturday.

May told reporters that, if her Conservative Party wins re-election on Thursday, she will not rescind the invitation, even though, she said, “I think Donald Trump was wrong in the things that he has said about Sadiq Khan.”

She added that she had been working closely on security matters with Khan, a member of the opposition Labour Party, since the London Bridge attack. “We have been working with Sadiq Khan,” May said, “party politics are put to one side, we work together to ensure that the response of London is right.”

The prime minister had initially refused to criticize Trump for lying about Khan, apparently out of fear that the notoriously thin-skinned president would hold it against her. May wants to avoid that at all costs because she hopes to offset the economic impact of Britain’s exit from the European Union by striking a trade deal with the United States.

That she finally relented, and offered the mildest rebuke possible, is a sign of the political pressure she felt in the final days of the election campaign, not to be seen to be either caving to Trump, who is reviled in Britain, or failing to support Khan, who is far more popular than she is in the nation’s largest city.

The previous mayor of London, Boris Johnson, who is now the nation’s foreign secretary, defended Khan’s handling of the crisis — saying that he was right to try to instill calm, in the remarks Trump distorted — but also said that there was no reason to call off the state visit.

Johnson’s intervention was interesting, because he, too, was highly critical of Trump when he served as London’s mayor, which brings into sharp focus the question of whether or not Trump’s attacks on Khan are motivated by political disagreements or anti-Muslim prejudice.

Jim Acosta of CNN raised this possibility on Monday, asking the president’s spokeswoman, Sarah Huckabee Sanders, what she would say to critics who ask, “Was the president attacking the mayor of London because he’s a Muslim?”

“Not at all,” Sanders replied, “and I think to suggest something like that is utterly ridiculous.”

To understand why that question was asked, it is important to understand that Trump alienated both the current and former mayors of London on December 7, 2015, when the then-candidate for the presidency demanded, “a total and complete shutdown of Muslims entering the United States, until our country’s representatives can figure out what the hell is going on.”

“Donald Trump is clearly out of his mind,” Johnson said two days later, “if he thinks that’s a sensible way to proceed, you can’t ban people going to the United States in that way, or indeed to any country.”

“What he’s doing,” Johnson continued, “is playing the game of the terrorists and those who seek to divide us. That’s exactly the kind of reaction they hope to produce.”

“I would invite him to come and see the whole of London and take him round the city,” Johnson added, “except that I wouldn’t want to expose Londoners to any unnecessary risk of meeting Donald Trump.”

Johnson also said at the time that Trump, by repeating the falsehood that certain parts of London were off-limits to non-Muslims, was “betraying a quite stupefying ignorance that makes him frankly unfit to hold the office of President of the United States.”

When Khan was elected five months later — in a landslide victory over a Conservative candidate who spread racially divisive innuendo about the supposed danger of electing a son of Pakistani Muslim immigrants to lead the British capital — he inherited the task of speaking out against Trump’s proposed ban.

After Trump suggested on the campaign trail that he might make an exception for London’s mayor, to allow him to visit the U.S., Khan rejected that idea, and did so in language strikingly similar to that used by Johnson.

“I think Donald Trump has ignorant views about Islam,” Khan told the BBC. “My concern is, he’s playing into the hands of extremists,” he added, by seeking to divide multicultural societies along religious lines.

Asked at the time for a response, Trump told his friend Piers Morgan that he was offended by Khan’s “rude statements,” and promised to hold a grudge. “Frankly, tell him I will remember those statements,” Trump said then.

After Trump became president, and sought to put a ban on travel from seven Muslim-majority nations into effect, Khan told Britain’s Channel 4 News in January that he thought a state visit to the British capital would send the wrong message.

“In the circumstances where there’s a ban in place, there shouldn’t be a state visit to the U.K.,” Khan said then. “While there is a cruel, while there is a shameful ban in place, we should not be rolling out the red carpet for the president of the United States of America.”

Khan, pressed to comment on Trump’s planned visit, simply restated that earlier position on Monday.

Apart from their current difference of opinion about whether Trump should be welcome to visit, it is clear that the two mayors have, at different times over the past 18 months, offered quite similar criticisms of the American’s plans to discriminate against Muslim travelers. Trump, however, has only continued to pick a fight with one of the two men — the one who happens to be Muslim himself.

When Khan was asked about his supposed “spat” with Trump on Tuesday morning, he made it clear that he had only ever responded to the American’s noxious comments, and reiterated that it was important to stand up for London’s multicultural society.

“By the way, we’re not kids in a playground, right?” Khan said, expressing exasperation about being constantly asked to respond to Trump’s taunts as he tried to deal with the aftermath of a terrorist attack. “He’s the president of the U.S.A.”

“Look, I’m too busy to respond to his tweets,” the mayor said. “Isn’t he busy?”