LONDON — The special relationship between the United States and Britain descended into name-calling on Tuesday, with President Trump tweeting that the British ambassador is “wacky,” “a very stupid guy” and “a pompous fool.”

In a trio of posts, Trump went on to insult outgoing Prime Minister Theresa May for her “failed Brexit negotiation.” Trump boasted that he told May how to do the deal, “but she went her own foolish way — was unable to get it done. A disaster!”

The president’s tirade gave a third day of life to controversy over leaked diplomatic cables in which British Ambassador Kim Darroch described the Trump White House as “inept,” “dysfunctional” and “unpredictable.”

The leak was highly embarrassing, not only for Darroch and May but also for the British Foreign Office. In a stroke, the cables appeared to undercut an intense English charm campaign to win over Trump, who was feted by Queen Elizabeth II, had tea with Prince Charles and commemorated a D-Day victory during an official state visit last month.

The escalating tensions have left Darroch’s position in doubt and have become an issue in the race to succeed May as prime minister, which pits Foreign Secretary Jeremy Hunt against front-runner and Trump favorite Boris Johnson.

On Monday, Trump vowed that the United States would “no longer deal with” Darroch. The White House then disinvited the British ambassador from a Monday dinner with Treasury Secretary Steven Mnuchin and the emir of Qatar. And on Tuesday, Darroch stayed out of sight and did not accompany Britain’s trade secretary to a White House meeting with the president’s daughter and adviser Ivanka Trump.

It remains unclear how far the Trump administration will go in cutting off its relationship with the ambassador and whether his tenure in Washington will end before his planned departure in early 2020.

The State Department has not been told by the White House to end contact with Darroch, agency spokeswoman Morgan Ortagus said Tuesday during a briefing with reporters.

“We will continue to deal with all accredited individuals until we get any further guidance from the White House or the president,” Ortagus said.

Her remarks suggest that Darroch will remain in place in Washington until London decides to recall him. Expelling Britain’s top envoy to Washington from the country would be a dramatic and historic measure given the nature of the “special relationship” between the two countries.

Downing Street maintained its position Tuesday that Darroch had the prime minister’s “full support” and stressed that ambassadors should be “able to provide honest, unvarnished assessments of the politics in their country.”

May is on her way out, though. And so there was speculation about whether the leak might have been designed to sideline Darroch before his term is up, to make way for someone more to Trump’s liking when a new prime minister forms a new government later this month.

The race to replace May will be decided by 160,000 voting members of the Conservative Party, and Johnson and Hunt duked it out in a live television debate Tuesday night.

Hunt took Trump to task and earned some of the biggest applause of the evening when he said, “I think his comments about Theresa May were unacceptable and he shouldn’t have made them.”

Earlier in the day, Hunt tweeted that “if I become PM our Ambassador stays.”

And at the debate, he maintained he would keep Darroch on until he is due to retire in 2020.

Johnson, a former foreign minister, held back from criticizing Trump and hedged on whether he would recall Darroch.

“I’m not going to be so presumptuous,” Johnson said, suggesting he had not won the race yet. But he added, “I and I alone will decide who takes important and politically sensitive jobs.”

Johnson has based much of his campaign on the need for Britain to take back control and reclaim its sovereignty. If he sought to curry favor with Trump by bringing Darroch back to London, Johnson would probably face political headaches at home.

Darroch, meanwhile, has been privately trying to assess how badly he has been damaged.

The ambassador has huddled for several days with key members of his staff, according to people familiar with the matter, but has not been able to get intelligence from the White House on why Trump continues to attack him.

One White House official said it was “unfortunate” what had happened with Trump’s comments because there previously had been “a very strong relationship.”

Contrary to Trump’s claim not to know Darroch, the two have met at least five times, according to officials with knowledge of the meetings. Their last encounter was at a lunch on Capitol Hill in March, officials said.

The ambassador is set to get some respite from the controversy — he is scheduled to leave for a vacation this week and not return to Washington until August.

Several British officials said Trump’s tweetstorm has had no effect on day-to-day interactions between British and American officials, who routinely work together on areas of mutual concern such as national security, trade and law enforcement.

Some in London said that the president’s criticism had actually elevated Darroch’s stature, particularly since it prompted the British government to back up the ambassador and praise him for being candid. One official, who spoke on the condition of anonymity to discuss the sensitive diplomatic situation, said that Trump’s vitriolic response had affirmed Darroch’s assessment that the president is thin-skinned and takes criticism of his administration personally.

It is unclear who would replace Darroch if he departs earlier than planned.

Mark Sedwill, who has served as national security adviser since 2017, was seen as a likely replacement. But last year, Sedwill became cabinet secretary, a more senior position, making it less clear whether he would replace Darroch in Washington.

In the British system, ambassadors are almost always career diplomats appointed by the foreign secretary with approval of the prime minister. As a result, the identity of the party in power does not traditionally play a major role in the type of person appointed to Washington.

Though it would be a rare move, the prime minister does have the power to cut short or extend a senior diplomat.

The U.S. system stands out in that it allows a president to name political appointees to ambassador postings around the world, even if they have no diplomatic experience. That practice, routine among Democratic and Republican administrations, has continued under the Trump ­administration, with appointments such as Woody Johnson, the New York Jets owner, as ambassador to Britain and Scott Brown, a former Republican senator from Massachusetts, as ambassador to New Zealand.

There are some rare exceptions in the British system. For instance, Ed Llewellyn, the British ambassador to France, is a political appointee and was chief of staff under Prime Minister David Cameron.

Former British foreign officials continued to come to Darroch’s defense Tuesday.

William Hague, a former foreign secretary, told the BBC: “You can’t change an ambassador at the demand of a host country. It is their job to give an honest assessment of what is happening in that country.”

Christopher Meyer, a former British ambassador to Washington, told the broadcaster that British ambassadors around the world will be looking at the controversy and may conclude that they should change practices.

“If they have something very sensitive to send back, they might not send it back, which is a very dangerous thing, or they might conclude, ‘Better if I hop on a plane and fly back to London,’ ” Meyer said.

He said that Darroch had not done “a single thing wrong” and that even if he is frozen out by the Trump administration, “he has an extremely capable staff who can hold the fort for a few months.”

Britain “should certainly not kowtow to the American president,” Meyer said.

Dawsey reported from Washington. John Hudson and Shane Harris in Washington contributed to this report.