LONDON (AP) — President Donald Trump arrived in Britain on Monday for a largely ceremonial visit meant to strengthen ties between the two nations, but the trip was immediately at risk of being overshadowed by Brexit turmoil and a political feud with London’s mayor.

Even before Air Force One touched down north of London, Trump unleashed a Twitter tirade against London Mayor Sadiq Khan, leader of the world city where Trump will stay for two nights while partaking in a state visit full of pomp and circumstance.

The move came after a newspaper column in which Khan said Trump did not deserve red-carpet treatment in Britain and was “one of the most egregious examples of a growing global threat” from the far-right to liberal democracy.

“@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,” Trump wrote just before landing. “He is a stone cold loser who should focus on crime in London, not me.

….Kahn 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. In any event, I look forward to being a great friend to the United Kingdom, and am looking very much forward to my visit. Landing now! — Donald J. Trump (@realDonaldTrump) June 3, 2019

The president added that Kahn reminded of the “terrible” mayor of his hometown, New York City Mayor Bill de Blaiso though “only half his height.” De Blaiso, a Democrat, is a longshot candidate in the 2020 presidential race. Khan supporters have previously accused Trump of being racist against London’s first Muslim mayor.

The president then added a few warm words for his hosts, tweeting that he was looking forward “to being a great friend to the United Kingdom, and am looking very much forward to my visit.”

The Trumps then boarded Marine One, the presidential helicopter, for the trip from Stansted Airport to the center of Britain’s capital.

The agenda for Trump’s weeklong journey is mostly ceremonial: a state visit and an audience with Queen Elizabeth II in London, D-Day commemoration ceremonies on both sides of the English Channel and his first presidential visit to Ireland, which will include a stay at his coastal golf club.

But the U.S. president will arrive at a precarious moment, as he faces a fresh round of impeachment fervor back home and uncertainty on the other side of the Atlantic Ocean. British Prime Minister Theresa May has faced months of political turmoil over Brexit and French President Emmanuel Macron is expected to use the 75th anniversary of the World War II battle that turned the tide on the Western Front to call for strengthening the multinational ties the U.S. president has frayed.

A sense of deja vu quickly spread around London as Trump blasted British leaders.

A year ago, Trump also took aim at his hosts before landing on English soil, blasting May in an interview just hours she hosted him for dinner. Though he has spared May so far this time, he has praised her rival, prime ministerial hopeful Boris Johnson, just days before May steps down as Conservative leader on Friday for failing to secure a Brexit deal.

“I think Boris would do a very good job. I think he would be excellent,” Trump told The Sun. “I like him. I have always liked him. I don’t know that he is going to be chosen, but I think he is a very good guy, a very talented person.”

It was not clear if the Trump endorsement would hurt or help Johnson’s chances of becoming Britain’s next leader.

He also told the Sunday Times that Britain should “walk away” from Brexit talks and refuse to pay a 39 billion pound ($49 billion) divorce bill if it doesn’t get better terms from the European Union. He said he might meet with another pro-Brexit politician, Nigel Farage, and claimed Farage should be given a role in the Brexit negotiations.

After lunch with Queen Elizabeth II, Trump will be honored at extravagant state dinner at Buckingham Palace. Demonstrators are expected, including the possible return of an inflatable balloon depicting the president as a baby.

And even some of the pageantry could have awkward moments. The formal tea hosted by Prince Charles brings together a future king who has warned repeatedly about the perils of climate change with a president who is actively dismantling U.S. policies designed to slow global warming.

In an interview with The Sun, Trump weighed in on the American-born Duchess of Sussex. The former Meghan Markle, who gave birth to a son in May and will not attend the week’s events, was critical of Trump in the past, prompting the president to tell the tabloid, “I didn’t know that she was nasty.”

FACT CHECK: Trump denies calling Duchess Meghan ‘nasty’

Trump said later that he thought Markle would be “very good” as a royal and claimed that he only meant her comments were “nasty.”

Trump will also make his first presidential visit to Ireland on Wednesday. Trump will spend two nights at his golf club in Doonbeg, which sits above the Atlantic. After Dublin balked at holding a meeting there, a deal was struck for Trump to meet Irish Prime Minister Leo Varadkar at Shannon Airport.

The centerpiece of the president’s visit will be two days to mark the 75th anniversary of the June 6, 1944, D-Day anniversary, likely the last significant commemoration most veterans of the battle will see. The anniversary events will begin in Portsmouth, England, where the invasion was launched, and then move to Normandy, France, where Allied forces began to recapture Western Europe from the Nazis.

The day is normally a heartfelt tribute to unity and sacrifice, outweighing any national or political skirmish. But some on both sides of the Atlantic are nervous about Trump, who has shown a willingness to inject partisanship into such moments.

“My greatest hope is this: the president and all the leaders stay focused on the extraordinary heroism of that of D-Day and focusing on what brought allies to that position,” said Heather Conley, senior vice president of the Center for Strategic and International Studies. “Dark clouds are forming once again in Europe, and rather than encourage those forces, we need to find much better tools to defeat them.”

On his most recent European visit, last November in France, Trump was heavily criticized for skipping a ceremony at an American military cemetery to mark the 100th anniversary of the end of World War I when rain grounded his helicopter. European leaders, meanwhile, stood in the rain to honor the dead.