London -- A scandal over leaked diplomatic cables has forced Britain's Ambassador to the United States, Sir Kim Darroch, to announce his resign. The U.K. Foreign and Commonwealth Office confirmed his departure from the post on Wednesday, just hours after President Trump lashed out again at Darroch, describing him as "wacky" and a "pompous fool" after the leaked documents revealed the envoy's dim view of the current U.S. administration.

Mr. Trump fired off a series of tweets about Darroch hours after British Prime Minister Theresa May's spokesman said on Tuesday that the veteran diplomat had her continued support. May told Britain's Parliament on Wednesday that Darroch's resignation was a "matter of great regret," and she lauded him for a "lifetime of good service."

The cables -- top secret internal communications between the ambassador and his colleagues back in London -- riled Mr. Trump to the point that the ambassador said his position was untenable.

Get Breaking News Delivered to Your Inbox

"The current situation is making it impossible for me to carry out my role as I would like," Darroch said in a statement released by the Foreign Office. "Although my posting is not due to end until the end of this year, I believe in the current circumstances the responsible course is to allow the appointment of a new ambassador."

Darroch's forthright, unfiltered views on the U.S. administration -- meant for a limited audience and discreet review -- appeared in leaked diplomatic documents that were published in Britain's right-leaning Mail on Sunday newspaper.

The disclosures caused embarrassment and an awkward situation for two countries that often celebrate their "special relationship."

"The wacky Ambassador that the U.K. foisted upon the United States is not someone we are thrilled with, a very stupid guy," Mr. Trump wrote in one tweet.

Mr. Trump's personal attacks on Darroch over the cables, which included a tweet stating that his administration would no longer work with the British diplomat, undeniably prompted the ambassador's resignation. The head of Britain's foreign service said Wednesday that the pressure from the White House was unprecedented.

Simon McDonald said it was "vitally important" that ambassadors were able to speak candidly in private and that it was the first time in his career a head of state had dismissed working with a British ambassador. McDonald told Parliament's Foreign Affairs Committee that even hostile states had not taken such action in his nearly 37 years in the department.

"This is not the first time a British ambassador has left post or resigned because of actions against the host government, but usually they are governments with whom we have problematic relations, rather than friendly relations," Simon said, adding that the trans-Atlantic relationship was "so deep and so wide that it will withstand any individual squall."

Brexit overtones to the debacle

In his Twitter comments Tuesday, Mr. Trump combined criticism of Darroch with a broadside at May, chiding the British leader for failing to get her Brexit deal with the European Union through Parliament.

"I told Theresa May how to do that deal, but she went her own foolish way-was unable to get it done. A disaster!" Mr. Trump tweeted. "I don't know the Ambassador but have been told he is a pompous fool."

The tweets by Mr. Trump, which followed a similar social media barrage on Monday, ratcheted up pressure on Britain's government. Darroch has been accused by some Brexit-backing U.K. politicians of lacking enthusiasm for Britain's departure from the European Union.

The journalist who reported the leak, Isabel Oakeshott, is a strong Brexit backer and an ally of Brexit Party leader Nigel Farage, who also is Britain's leading champion of Mr. Trump.

Mr. Trump once said Farage would "do a great job" as ambassador to the United States. Farage sidestepped the idea Monday, saying "I'm not a diplomat."

The tiff with Mr. Trump also put pressure on Boris Johnson and Jeremy Hunt, the two men vying to succeed May as Conservative leader and prime minister. Both say they will lead the U.K. out of the European Union and secure new trade deals around the world -- notably with the United States.

The leaks

An investigation is underway to find who was responsible for leaking the memos, a major breach of diplomatic security.

Darroch has served as Britain's envoy in Washington since 2016. In one of his leaked memos, he said that to communicate effectively with Mr. Trump, "you need to make your points simple, even blunt."

The published documents also included the ambassador calling the Trump administration's policies on Iran "incoherent," saying the U.S. president might be indebted to "dodgy Russians," and raising doubts about whether the Trump White House "will ever look competent."

But Darroch has had a close relationship with numerous Trump administration officials. The president's advisers have been frequent guests at British Embassy events.

While British officials hunted for the culprit behind the leak, senior Conservative Party figure and former Foreign Secretary William Hague said the government was right to back Darroch.

"You can't change an ambassador at the demand of a host country," Hague told the BBC. "It is their job to give an honest assessment of what is happening in that country."