LONDON — President Donald Trump started his state visit to the U.K. on Monday by calling Mayor Sadiq Khan of London a "stone cold loser" who has done a "terrible job."

"Khan reminds me very much of our very dumb and incompetent Mayor of NYC, de Blasio, who has also done a terrible job — only half his height," the president wrote.

.@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...... — Donald J. Trump (@realDonaldTrump) June 3, 2019

His comments came after Khan wrote an opinion piece in The Observer newspaper on Sunday condemning Trump’s state visit and grouping him together with far-right leaders in Europe.

“It’s so un-British to be rolling out the red carpet this week for a formal state visit for a president whose divisive behaviour flies in the face of the ideals America was founded upon — equality, liberty and religious freedom,” wrote Khan, who is the son of a Pakistani bus driver.

"At what point should we stop appeasing — and implicitly condoning — his far-right policies and views? Where do we draw the line?" he continued.

It wasn’t the first time that the mayor, who is Muslim, has criticized the president. After Trump suggested a ban on Muslims entering in the U.S. during his campaign for president, the then newly installed mayor said he wanted “to educate Donald Trump. I want to show him that you can be Muslim and be Western.”

Then, just after the June 2017 terror attack in London Trump criticized Khan, seemingly misunderstanding the mayor’s remarks about the attack and calling them a “pathetic excuse.”

Khan then called for the offer of a state visit to be rescinded.

London Mayor Sadiq Khan Jack Taylor / Getty Images file

Trump’s tweets about the mayor on Monday came after Trump spent the last few days inserting himself into British politics, breaching the diplomatic custom that heads of state don't meddle in the domestic affairs of the nations they are visiting.

Over the weekend, Trump endorsed former London Mayor Boris Johnson to succeed Theresa May as prime minister and leader of the Conservative Party. May is stepping down on Friday.

The president also criticized the American-born Duchess of Sussex, the former Meghan Markle, saying that “he didn’t know that she was nasty,” after hearing comments about him she made during the 2016 campaign.

The Monday morning tweets about Khan reiterated comments Trump made just before leaving the U.S.

When asked by reporters if he would be willing to meet with Khan in London, Trump replied: "No, I don't think much of him. He's the twin of de Blasio, except shorter."

Asked about Trump's Tweet in an interview to CNBC Tuesday morning, London mayor Sadiq Khan said he was not going to respond to Trump by name-calling. “This is the sort of behavior I expect from an 11-year old, not from a leader, let alone the president of the United States.”

British politicians were quick to condemn Trump's comments, with one opposition Labour lawmaker suggesting Trump’s opposition to Khan stemmed from the mayor’s religion.

“Wonder why you have a problem with London's first ever Muslim mayor?” tweeted David Lammy, who represents a north London constituency and is outspoken on race issues.

“Doesn’t help Britain to be lavishing pomp on a president so determined to be divisive, childish & destructive,” tweeted senior Labour politician Yvette Cooper.

During the visit, Trump will be treated to a display of British royal pageantry including lunch and a formal state dinner with the queen, tea with Prince Charles and a tour of Westminster Abbey, the coronation church of English monarchs for nearly a thousand years.

He will also commemorate the 75th anniversary of D-Day.

He was greeted at the airport by foreign minister and Conservative leadership candidate Jeremy Hunt, who said that Trump had mentioned the mayor to him on arrival.

"He wasn't exactly saying that he's going to be inviting Sadiq Khan for royal treatment at the White House any time soon," Hunt told the BBC, declining to give further details of the conversation.