By Alan McGuinness, political reporter
Sir Kim Darroch has resigned as the UK's ambassador to the US amid a row over leaked memos that were critical of Donald Trump.
Sir Kim said the furore over the messages, in which he called the US president "inept", was "making it impossible for me to carry out my role as I would like".
According to Sky's deputy political editor Sam Coates, Sir Kim "decided the game was up" when Boris Johnson refused to guarantee that he would stay in position if he became prime minister.
The frontrunner to succeed Theresa May in Number 10 has been criticised for his remarks, although he said in the wake of the resignation that he regretted the news because "he [Sir Kim] is a superb diplomat and I worked with him for many years".
Foreign Secretary Jeremy Hunt, Mr Johnson's rival in the race for Downing Street, said he "profoundly" regretted Sir Kim's resignation and was "outraged" at the leak.
Foreign Office minister Sir Alan Duncan, a supporter of Mr Hunt, told Sky News that Mr Johnson had "basically thrown him under the bus".
"I think that the conduct of Boris Johnson has discredited him enormously in the eyes of many people in this country," he said.
More from Boris Johnson
Sir Kim's decision was revealed in a letter to Sir Simon McDonald, the permanent under secretary at the Foreign and Commonwealth Office.
He said: "Since the leak of official documents from this embassy there has been a great deal of speculation surrounding my position and the duration of my remaining term as ambassador.
"I want to put an end to that speculation.
"The current situation is making it impossible for me to carry out my role as I would like.
"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."
In the memos, which were published in the Mail on Sunday at the weekend, Sir Kim described Mr Trump as "incompetent", "inept" and "insecure".
He also said the White House under America's 45th president had become "uniquely dysfunctional" because of "vicious infighting and chaos", and questioned whether it "will ever look competent".
Mr Trump has reacted with fury to the contents of the messages, attacking both Sir Kim and Prime Minister Theresa May.
On Tuesday he called the ambassador "wacky", "very stupid" and "pompous" and again hit out at the PM's handling of Brexit.
Mrs May said the resignation was a "matter of great regret".
"The whole cabinet rightly gave its full support to Sir Kim on Tuesday," she told MPs in the Commons.
"Sir Kim has given a lifetime of service to the United Kingdom and we owe him an enormous debt of gratitude.
"Good government depends on public servants being able to give full and frank advice.
"I want all our public servants to have the confidence to be able to do that and I hope the House will reflect on the importance of defending our values and principles, particularly when they are under pressure."
Labour leader Jeremy Corbyn also expressed his "regret".