LONDON — Britain’s ambassador to the United States resigned Wednesday after being branded a fool and made a diplomatic nobody by President Donald Trump following the leak of the envoy’s unflattering opinions about the U.S. administration.

Storm clouds gathered over the trans-Atlantic relationship as veteran diplomat Kim Darroch said he could no longer do his job in Washington after Trump cut off all contact with the representative of one of America’s closest allies.

The break in relations followed a British newspaper’s publication Sunday of leaked documents that revealed the ambassador’s dim view of Trump’s administration, which Darroch described as dysfunctional, inept and chaotic.

“The current situation is making it impossible for me to carry out my role as I would like,” Darroch said in his resignation letter. He had been due to leave his post at the end of the year.

In the leaked documents, he called the Trump administration’s policy toward Iran “incoherent,” said the president might be indebted to “dodgy Russians” and raised doubts about whether the White House “will ever look competent.”

“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,” one missive said.

Prime Minister Theresa May and other British politicians praised Darroch, condemned the leak — and criticized Trump’s intemperate comments, if only implicitly. Pointedly, however, Boris Johnson, considered the front-runner to replace May as prime minister, did not defend the ambassador after Trump’s tirade.

Foreign Secretary Jeremy Hunt, Johnson’s rival for the post, said Wednesday it was “absolutely essential that when our diplomats do their job all over the world ... we defend them.”

“We had a fine diplomat who was just doing what he should have been doing — giving a frank assessment, a personal assessment of the political situation in the country that he was posted (to) — and that’s why I defended him,” he told reporters. “And I think we all should.”

Speaking at a conference on media freedom, Hunt also criticized Trump’s verbal attacks on journalists.

“I wouldn’t use the language President Trump used, and I wouldn’t agree with it,” he said. “We have to remember that what we say can have an impact in other countries where they can’t take press freedom for granted.”

Darroch announced his decision the morning after a televised Conservative leadership debate between Hunt and Johnson. During the debate, Hunt vowed to keep Darroch in the post, but Johnson — his predecessor as foreign secretary — notably did not support the British envoy.

“I think it’s very important we should have a close partnership, a close friendship with the United States,” said Johnson, whom Trump has praised in the past.

Emily Thornberry, the spokeswoman on foreign affairs for the main opposition Labour Party, said Darroch “has been bullied out of his job, because of Donald Trump’s tantrums and Boris Johnson’s pathetic lick-spittle response.”

Darroch’s forthright, unfiltered views on the U.S. administration — meant for a limited audience and discreet review — appeared in the leaked documents published by Britain’s Mail on Sunday newspaper.

Darroch had served as Britain’s envoy to Washington since 2016; the leaked cables covered a period from 2017 to recent weeks.

British officials are hunting for the culprit behind the leak, which was both an embarrassment to May’s government and a major breach of diplomatic security.

“We will pursue the culprit with all the means at our disposal,” Foreign Office chief Simon McDonald told a committee of lawmakers, adding that police were involved in the investigation.

McDonald said it was “vitally important” that ambassadors were able to speak candidly in private and that it was the first time in his 37-year career that a head of state had refused to work with a British ambassador.

But he said the trans-Atlantic relationship was “so deep and so wide that it will withstand any individual squall.” He also said he feared there might be more leaks of sensitive government documents.

The U.S. State Department said in a statement that “the United States and the United Kingdom share a bond that is bigger than any individual, and we look forward to continuing that partnership. We remain committed to the U.S.-UK Special Relationship and our shared global agenda.”

Like his predecessors, Darroch was a prominent figure in Washington, meeting frequently with high-level U.S. officials and hosting parties at the stately British Embassy.

Gatherings were frequently bipartisan, drawing guests from the Trump and Obama administrations, who mingled with journalists and members of prominent think tanks.

Darroch often addressed the attendees at such gatherings, making sure to single out high-level administration officials.

Trump’s tweets created a furor among many British politicians and officials, who found themselves insulted by the president’s decision to have the administration cut off contact with their ambassador.

It underscored that the close relationship between the two countries has become increasingly lopsided — a severe problem as the U.K. prepares to set a new path with its departure from the European Union.

“It is shameful that Kim Darroch has effectively been forced out for doing the job that diplomats are appointed to do,” Scottish First Minister Nicola Sturgeon tweeted. “Boris Johnson’s failure last night to stand up for him — and stand up to the behavior of Donald Trump — spoke volumes.”

Foreign Office minister Alan Duncan — who served under Johnson when he was foreign secretary — went further, accusing Johnson of having “thrown our top diplomat under a bus” for his own personal interests.

But Trump supporter and Brexit Party leader Nigel Farage described the resignation as, “the right decision.”

“Time (to) put in a non-Remainer who wants a trade deal with America,” he tweeted.

It’s unclear whether May will have time to name a replacement before she leaves office later this month.

Appointing ambassadors usually involves a formal civil service process with advertisements, applications and interviews, though Simon McDonald, head of Britain’s diplomatic service, said the post of ambassador to the U.S. wasn’t always chosen that way.

“History shows that there are often bespoke procedures for filling the embassy in Washington, DC,” he said.

Associated Press writer Julie Pace contributed from Washington.