(CNN) President Donald Trump's power play in hectoring Britain's ambassador out of the country dealt humiliation to America's top ally and sent a message that strong relations with the US are dependent on flattering the President.

Kim Darroch resigned Wednesday for doing his job — sending home blunt diplomatic cables about the US government some of which said Trump's White House had at times been "inept" and that the President was insecure.

He took the honorable course after the cables leaked, and his long and distinguished career was crushed by more powerful men seeking political advantage in a drama that illustrates both Trump's vanity and considerable personal power and a weakened Britain's increasing reliance on the US.

Trump was furious about the criticism in Darroch's work and made clear to London that he should be dismissed by cutting off his access to the White House, making his job impossible.

And Britain's likely next Prime Minister Boris Johnson, who wants to forge close ties to Trump, declined to offer his support for Darroch in a leadership debate on Tuesday night. A UK government source said Darroch took his decision to resign after watching Johnson effectively leave his own position untenable.

"The current situation is making it impossible for me to carry out my role as I would like," Darroch wrote in his resignation letter.

The episode sent a message to US allies — that unsparing if widely recognizable assessments of Trump's behavior and the conduct of his administration are unacceptable and that flattery is the glue binding strong diplomatic relationships with the US.

It calls into doubt the practice of diplomacy itself — that foreign states have the prerogative to decide exactly who represents them abroad rather than leaders of their host country. Ambassadors often send frank analysis of their host nation and its political personalities back to base. As the mass leak of WikiLeaks disclosures of classified US diplomatic t raffic in 2010 showed, US envoys are no exception.

Trump effectively made the point that only a British ambassador who hides the reality of his chaotic, divided administration will be welcome in his White House -- a position that threatens the capacity of foreign nations to get accurate reporting and internal intelligence about what is going on in Washington.

The diplomatic storm over the Darroch cables came only a month after Queen Elizabeth rolled out lavish British pageantry for the President during his state visit to London. It is a reminder that while Trump enjoys such treatment in the moment, it rarely creates a stock of goodwill that can be depended upon to shape his policies and attitudes towards particular countries.

A victory for the President

There was no immediate comment from the President after Darroch's resignation, but his team was digesting a clear political victory for Trump.

"I think the reality was that in light of last few days, his ability to be effective was probably limited so it's probably the right course," Vice President Mike Pence's chief of staff Marc Short told reporters.

Darroch's departure shows the danger of getting on the wrong side of a President who blasted the ambassador as "wacky" "a very stupid guy " and a "pompous fool" on Tuesday.

Darroch also became the victim of the meltdown in British politics over the country's vote to leave the European Union and Trump's frequent interventions in UK politics to support it.

And it offered a reward for one of the most damaging recent leaks in British political history, after Darroch's cables ended up emblazoned across the front of this week's "Mail on Sunday" newspaper.

Trump has been outspoken in support of Johnson, who shares his populist, flamboyant and truth-challenged approach to politics, but his treatment of Darroch has left the possible new British prime minister in a difficult spot.

If Johnson wins the Conservative Party leadership election, his attitude towards Trump will come under fearsome scrutiny. If he appoints an ambassador outside Britain's diplomatic service who is sympathetic to Trump, he will be viewed as already under the President's influence.

The head of Britain's Brexit party, Nigel Farage, who wields considerable power on Johnson's right and often boasts of his friendship with Trump was quick to crank up political pressure.

"The right decision, time (to) put in a non-Remainer who wants a trade deal with America," Farage tweeted. Remainers are Britons who do not want to leave the EU and Darroch, a former senior diplomat in Brussels, was seen in the UK as sympathetic to the bloc.

If the UK finally leaves the European Union at the end of October as Johnson has promised, it will be reliant on the US for a swift bilateral trade deal to help offset the loss of preferential treatment to European markets.

Other ambassadors in Washington will now be looking closely at Britain's conduct to see whether intimidation and pressure from Trump will affect its position -- especially on other areas of disagreement with the US including over how to handle Iran.

Johnson, a former British foreign secretary, reacted to Darroch's decision by saying that the leaker had done a "grave disservice" to civil servants while speaking on Sky News.

But unlike other British politicians, he did not praise Darroch for his conduct or make any comments that might anger Trump.

The current British Foreign Secretary Jeremy Hunt, Johnson's last rival in the leadership race, did praise Darroch — as did the outgoing Prime Minister Theresa May.

"Standing up for Britain means standing up for the finest diplomats (in) the world. It should never have come to this," Hunt wrote on Twitter.