British Ambassador to the United States Kim Darroch. (Paul Morigi/Getty Images)

President Trump said Monday that the United States would “no longer deal with” the British ambassador who disparaged his administration.

In a cache of diplomatic cables leaked and published over the weekend, Ambassador Kim Darroch described the Trump White House as “inept,” “dysfunctional” and “unpredictable.”

Trump tweeted his displeasure on Monday — and more than hinted that he is looking forward to a change: “I do not know the Ambassador, but he is not liked or well thought of within the U.S. We will no longer deal with him. The good news for the wonderful United Kingdom is that they will soon have a new Prime Minister.”

The British Embassy declined to comment.

A statement from Prime Minister Theresa May’s office Monday said the leaks “do not reflect the closeness of, and the esteem in which we hold, the relationship.”

The statement said Darroch retains the prime minister’s “full support,” and a spokesman stressed that May did not share in her ambassador’s critiques.

But May is on her way out — shoved from power by her own party for her failure to deliver Brexit. And so there was speculation in British political circles about whether the leak might have been designed to push the Europhile Darroch out of Washington before his term is up in 2020, to be replaced by someone more to Trump’s liking when a new prime minister forms a new government later this month.

Trump provoked controversy once before by weighing in on British diplomatic postings. After his election in November 2016, Trump tweeted, “Many people would like to see @Nigel_Farage represent Great Britain as their Ambassador to the United States. He would do a great job!”

Farage is a polarizing radio show personality and prominent pro-Brexit politician.

Since coming into office, Trump officials have had a generally cordial relationship with the British diplomatic corps in Washington.

Senior Trump officials regularly party at the embassy, and a coterie — including Kellyanne Conway, Stephen Miller, Mick Mulvaney, Sarah Sanders and Trump ally Chris Ruddy — have all been guests for private dinners, where they share about the president and his ­decision-making. Matt Whitaker, as acting attorney general, was seen dancing there after midnight on New Year’s Eve.

Darroch himself frequently meets with national security adviser John Bolton and had early-morning breakfast meetings with John Kelly, then the former chief of staff, according to people familiar with the matter who, like others in this report, spoke on the condition of anonymity. He has been key in working with Trump’s aides behind the scenes to arrange visits to Britain in a way that would avoid angering the president, White House and embassy officials say.

A senior administration official said Darroch would no longer be invited to U.S. government events.

Although Trump said he does not know Darroch, he has spoken with him several times during visits overseas and in bilateral meetings. The president also quizzed the ambassador about ­Brexit during a lunch at the Capitol this spring.

Trump was told about the leaked cables this weekend at his golf course in Bedminster, N.J., aides said, and complained about how they were dominating TV.

Diplomats trashing their hosts is hardly unusual — as was evident in the 2010 release of tens of thousands of U.S. diplomatic cables by WikiLeaks.

“His comments are entirely unsurprising from a historical perspective,” Calder Walton, a British lawyer and a fellow at Harvard University, wrote in an email. “Ambassadors rely on being able to give frank (often undiplomatic) opinions about their resident countries.”

A person familiar with the cables said they are often more anodyne — they come from interviews with White House officials, lobbyists, journalists and others and are an attempt to decipher what is happening in Washington for officials in London.

Darroch himself does not write all of the cables but signs off on them before they go back to Britain, according to people familiar with the matter.

Excerpts of the correspondence were published in a report by the Mail on Sunday tabloid. On Sunday, British officials confirmed the authenticity of the cables.

Britain’s international trade secretary, Liam Fox, said he would issue an apology to Ivanka Trump when the two met in Washington on Monday. (Why the British minister, whose job is to negotiate a new free-trade deal with the United States, was meeting with the president’s daughter and special adviser was not revealed.)

Fox stressed that he was outraged, not at Darroch, but at the unknown leaker, whom he called an “unpatriotic” underminer of the relationship between the United States and Britain.

Fox said he suspected that the perpetrator was either a member of the civil service or the “political class” — which did not do much to narrow the number of possible sources.

“This is such a damaging, potentially damaging, event, that I hope the full force of our internal discipline, or even the law, will come down on whoever actually carried out this particular act,” Fox told the BBC.

The leak comes as Foreign Secretary Jeremy Hunt and his predecessor in the position, Boris Johnson, campaign among 160,000 Conservative Party voters to be the next party leader and prime minister.

On Monday, Hunt announced an investigation into the leak — and stressed that he, too, did not share Darroch’s impression of the American president as “‘insecure” and “incompetent.”

In a 2017 memo, Darroch wrote: “We don’t really believe this Administration is going to become substantially more normal; less dysfunctional; less unpredictable; less faction riven; less diplomatically clumsy and inept.”

Hunt couched that as “a personal view, and there will be many people in this building who don’t agree with that view, and indeed I don’t agree with some of the views that we saw in those letters.”

“I think the U.S. administration is highly effective,” Hunt said, “and we have the warmest of relationships and a partnership based on standing up for shared values.”

At the same time, Hunt sought to ward off a freeze on diplomatic correspondence.

“So I think it’s very important that our ambassadors and high commissioners around the world continue to feel that they are able to express those frank views,” Hunt said, praising the British Foreign Service as “one of the best diplomatic networks in the world.”

Jo Swinson, the deputy leader of the Liberal Democrats, retweeted Trump’s missive with the comment, “Whether Johnson or Hunt take the keys to Number 10, both will continue to roll over and put up with President Trump’s tantrums.” Many commentators also observed that Darroch’s reportage was not that different from what could be read in almost any U.S. newspaper.

The trove of sensitive material was leaked to a prominent political journalist, Isabel Oakeshott, who also happens to be close to leading hard-line Brexiteers, including Farage. Oakeshott was the ghost writer behind Brexit funder Arron Banks’s book “The Bad Boys of Brexit.”

Oakeshott did not reveal the source of the leak. But she offered what might be clues on Twitter.

Oakeshott posted: “Enjoying the conspiracy theories. Isn’t it much simpler? In the absence of government, the civil service becomes politicised. . . .”

She also wrote: “ ‘Too many civil servants rubbishing Brexit — that’s why the #washingtonfiles leak happened’ suggests ­@Nigel_Farage. Sounds about right.” She retweeted Farage’s call for Darroch to be fired.

Asked Monday by BBC Radio whether he could replace Darroch as ambassador, Farage replied: “No. I don’t think I’m the right man for that job.”

He joked that he was obviously not very diplomatic.

“But, am I the right man to try and help forge a better, closer relationship in terms of intelligence, security and trade with an administration that contains friends of mine?” Farage said. “Yes, I could be very useful.”

Dawsey reported from Washington. Karla Adam in London and Adam Taylor in Washington contributed to this report.