Theresa May and her husband Philip May greet the Trumps at Blenheim Palace on Thursday. Photo: WPA Pool/Getty Images

Donald Trump was invited to a state visit to the U.K. just one week into his presidency, but as he cultivated a feud with one of our closest allies, the trip was repeatedly delayed due to the threat of massive protests, and downgraded to a “working visit” — meaning Trump would be denied his golden-carriage ride.

Trump couldn’t let this humiliation stand, so he found a way to ensure that the headlines during his trip would focus on his scorching attacks, not the insults hurled at him by large swaths of the British public.

Just after he dined at the family home of Sir Winston Churchill in Oxfordshire — the first in a series of stops designed to keep him from protesters — the Rupert Murdoch–owned newspaper the Sun published an interview in which he bashed Prime Minister Theresa May’s Brexit plan, suggested her rival Boris Johnson would make a great prime minister, and blamed his old foe Sadiq Khan, the mayor of London, for terrorism in the city.

He also lamented that immigrants are stealing Europe’s culture, his clearest articulation of white-nationalist rhetoric since he complained about the loss of our “beautiful” Confederate monuments.

“I think what has happened to Europe is a shame,” Trump said. “Allowing the immigration to take place in Europe is a shame. I think it changed the fabric of Europe and, unless you act very quickly, it’s never going to be what it was and I don’t mean that in a positive way. So I think allowing millions and millions of people to come into Europe is very, very sad. I think you are losing your culture. Look around. You go through certain areas that didn’t exist ten or 15 years ago.”

It seems both British and U.S. officials were caught off guard by Trump’s attacks (though he’s been making particularly harsh jabs at May and other NATO allies all week). The British gave Trump a bit of the pomp he craves before Thursday’s black-tie dinner, with a military parade outside Blenheim Palace. In her remarks during the dinner, May pitched Trump on a bilateral trade deal post-Brexit.

“Now, as we prepare to leave the European Union, we have an unprecedented opportunity to do more. It’s an opportunity to reach a free trade agreement that creates jobs and growth here in the U.K. and right across the United States,” she said.

But within an hour, the Sun published its report, in which Trump said that if she proceeded with a Brexit plan that maintains close ties to the E.U., against his advice, that would be impossible. “If they do a deal like that, we would be dealing with the European Union instead of dealing with the U.K., so it will probably kill the deal,” he said.

May’s office had no immediate reply, and instead referred reporters to her earlier statement: “We have come to an agreement at the proposal we’re putting to the European Union which absolutely delivers on the Brexit people voted for. They voted for us to take back control of our money, our law and our borders and that’s exactly what we will do.”

The Washington Post reports that U.S. officials thought the story would appear on Friday morning, and were startled to see it online as they left the dinner. An official said White House press secretary Sarah Huckabee Sanders had alerted the British about the interview, but thought it would be more positive. That seems doubtful, as Sun reporter Tom Newton Dunn said Sanders was in the room during his wild, half-hour chat with the president. She even tried to end the interview after the scheduled ten-minute slot, but Trump brushed her off, saying he wanted to continue.

Later Dunn told the BBC that he was struck by the unrestrained power Trump had over those around him. “I felt as though I’d been in the court of an imperial Chinese emperor from the 15th century. The sheer total power that the man has is quite overcoming really,” he said.

Many U.K. politicians expressed new outrage over Trump’s remarks, and May’s opponents took the opportunity to paint her as weak. On Good Morning Britain, shadow foreign secretary Emily Thornberry said it was “extraordinarily rude of Donald Trump to behave like this,” and called on May to rebuke Trump, saying she’s “letting down our country by not standing up to him.”

Labour leader Jeremy Corbyn posted a video recapping Trump’s worst qualities and said May was “awarding President Trump with a red carpet welcome.”

Theresa May has invited President Trump to our country at a time when his dangerous and inhumane policies are putting the lives and wellbeing of millions of people at risk. #TrumpUKVisit pic.twitter.com/69HdBTzkji — Jeremy Corbyn (@jeremycorbyn) July 13, 2018

Vince Cable, the leader of the Liberal Democrats, took a jab at Trump’s pal Boris Johnson, who resigned to protest May’s Brexit proposal earlier this week.

So @realDonaldTrump now chooses our leaders. Hardly a surprise we are treated like Panama or El Salvador when government grovels for favours. Truly a #VassalState . No surprise Trump has chosen @BorisJohnson a narcissistic self-absorbed political twin. — Vince Cable (@vincecable) July 13, 2018

Labour MP David Lammy said Trump attacked Khan because he’s racist, and called for a cancelation of his visit with the Queen on Friday.

I will call it like it is. The real reason Trump blames my friend @SadiqKhan for the terror attacks last year is simple. He hates that London chose a Muslim mayor. The President is racist. He does not deserve to meet our Queen today #StopTrump — David Lammy (@DavidLammy) July 13, 2018

Trump did have some defenders among Brexit hard-liners. Conservative MP Jacob Rees-Mogg said he saw nothing wrong with Trump’s remarks on Brexit. “The U.K. wants to do a trade deal with Donald Trump and he said if you want to a trade deal with the United States this isn’t the way to do it,” Rees-Mogg said, adding later, “That’s a perfectly reasonable thing for an American president to say.”

Conservative MP Sir Alan Duncan told Radio 4’s “Today” that Trump is “entitled to his opinion,” and he wasn’t insulted.

“Donald Trump is in many ways a controversialist — that’s his style, that’s the color he brings to the world stage and he is in that sense very unconventional,” he said. “I don’t think we see it as rude and I think the atmosphere last night at the Blenheim dinner was very, very special actually.”

White House officials were reportedly scrambling to figure out what to say to May following the interview. “There’s no way Trump will apologize,” a senior U.S. official told the Post. “But we also don’t want to blow everything up.”

Sarah Huckabee Sanders went with denial, as she often does.

“The president likes and respects Prime Minister May very much,” she said in a statement. “As he said in his interview with the Sun she ‘is a very good person’ and he ‘never said anything bad about her.’”

She added that Trump “is thankful for the wonderful welcome from the prime minister here in the U.K.”

But Trump acknowledged in the Sun interview that he was disappointed by the massive protests in London, and he seemed quite familiar with the “Trump baby” blimp that will fly above Parliament Square during Friday’s protests.

The Trump baby blimp is up over Westminster. One of the most surreal images of Westminster Abbey and Parliament in history... pic.twitter.com/PBKDImaje7 — Brian Klaas (@brianklaas) July 13, 2018

“I guess when they put out blimps to make me feel unwelcome, no reason for me to go to London,” he said. “I used to love London as a city. I haven’t been there in a long time. But when they make you feel unwelcome, why would I stay there?”

Trump then pivoted to willful denial as well, saying he was “talking about government because the ­people of the U.K. agree with me.” (A poll released this week found 77 percent of Britons have an unfavorable opinion of Trump.)

“Many people are delighted. I get thousands of notifications from people in the U.K. that they love the president of the United States,” Trump said, pointing to a single pub throwing him a welcome party.

Then Trump bragged that he’s more popular than Abraham Lincoln, according to a poll he probably made up.

“You know, a poll just came out that I am the most popular person in the history of the Republican Party — 92 percent. Beating Lincoln. I beat our Honest Abe.”

Trump once claimed he could be “more presidential than any president that’s ever held this office” except for Lincoln, but systematically attacking all of our allies must have put him over the top.