LONDON -- Mixing pageantry and pugilism, U.S. President Donald Trump plunged into his long-delayed state visit to Britain on Monday, welcomed with smiles and a cannon salute by the royals but launching political insults at others in a time of turmoil for both nations in the deep, if recently strained, alliance.

It was a whirlwind of pomp, circumstance and protest for Trump, who had lunch with Queen Elizabeth and tea with Prince Charles before a grand state dinner at Buckingham Palace.

The queen used her toast to emphasize the importance of international institutions created by Britain, the United States and other allies after World War II, a subtle rebuttal to Trump, a critic of NATO and the UN.

But most of the talk and the colorful images were just what the White House wanted to showcase Trump as a statesman while, back home, the race to succeed him -- and talk of impeaching him -- heated up. Yet Trump, forever a counter-puncher, immediately roiled diplomatic docility by tearing into London Mayor Sadiq Khan.

The agenda for Trump's weeklong European journey is mostly ceremonial:

Later this week come 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. For most presidents, it would be a time to revel in the grandeur, building relations with heads of state and collecting photo-ops for campaign ads and presidential libraries.

But Trump has proven time and again he is not most presidents.

With the trip already at risk of being overshadowed by Britain's Brexit turmoil, Trump unleashed a Twitter tirade after a newspaper column in which London's mayor said he did not deserve red-carpet treatment and was "one of the most egregious examples of a growing global threat" to liberal democracy from the far right.

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

Khan supporters have previously accused Trump of being racist against London's first Muslim mayor.

During the palace welcome ceremony, Trump and Prince Charles inspected the Guard of Honor formed by the Grenadier Guards wearing their traditional bearskin hats. Royal gun salutes were fired from nearby Green Park and from the Tower of London as part of the pageantry accompanying an official state visit, one of the highest honours Britain can bestow on a foreign leader.

But the U.S. president arrived at a precarious moment. There is a fresh round of impeachment fervour back home and uncertainty on this side of the Atlantic. British Prime Minister Theresa May has undergone months of political turmoil over Britain's planned exit from the European Union, 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 multinational ties the U.S. president has frayed.

A sense of deja vu quickly spread around London as Trump barrelled into the visit.

A year ago, he also had taken aim at his hosts before landing on English soil, blasting May in an interview hours before she hosted him for dinner. This time he has so far spared May, whom he will meet with on Tuesday, but he also has praised her rival, 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 that endorsement would help or hurt Johnson's chances of becoming prime minister. Trump said he may meet with Johnson this week.

Never shy about weighing in on other countries' affairs, Trump 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 the queen, Trump was given a biography of Winston Churchill as a gift -- he's a fan -- and shown parts of the collection at Buckingham Palace, including an 18th-century map of New York, historic photos of golf at St. Andrews and books about birds and George Washington. Westminster Abbey was next, with a tour and moment of silence at the tomb of the Unknown Warrior.

As Trump crossed London, he was shadowed -- at a distance -- by demonstrators, who planned to fly again a huge balloon depicting the president as a baby. He declared there was "great love all around" but the Fake News would try to find protests.

As often happens when Trump travels overseas, norms were shattered, including when the president complained about his television viewing options in the foreign capital and urged people to punish CNN by boycotting its parent company, AT&T.

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, has been critical of Trump, and when some of her comments were recited to him he told the tabloid, "I didn't know that she was nasty."

He said later he thought Markle would be "very good" as a royal and claimed he only meant her comments were "nasty."

Trump will make his first presidential visit to Ireland on Wednesday, spending two nights at his golf club in Doonbeg, which sits above the Atlantic. After Dublin balked at holding a meeting in the city, a deal was struck for Trump to meet Irish Prime Minister Leo Varadkar at the VIP lounge at Shannon Airport, hardly the grand setting usually afforded a meeting of world leaders.

The centerpiece of the president's European trip will be two days to mark the 75th anniversary of the June 6, 1944, D-Day landing, likely the last significant commemoration most veterans of the battle will see. The events will begin in Portsmouth, England, where the invasion was launched, and then move across the Channel to 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.

------

AP writers Gregory Katz in London and Darlene Superville and Deb Riechmann in Washington contributed.