The British ambassador to the United States has resigned just one day after US President Donald Trump called him a "wacky ambassador" and "very stupid guy" on Twitter.
Sir Kim Darroch, wrote in a letter to Sir Simon McDonald, the permanent undersecretary at the Foreign Office, that "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," he wrote.
Sir Kim's emails had been leaked to the Daily Mail describing the US president's administration as "inept".
“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," Sir Kim continued in his letter.
Sir Simon accepted the resignation "with deep personal regret".
"Over the last few difficult days you have behaved as you have always behaved over a long and distinguished career, with dignity, professionalism and class," he wrote in response to the letter.
A spokesperson for Theresa May had said earlier in the week that Sir Kim continued to have Prime Minister Theresa May's "full support".
But the US president said in a series of tweets on Monday that his administration would "no longer deal with him".
Social media reaction
The UK foreign secretary and Tory leadership candidate Jeremy Hunt tweeted that he was "saddened" to learn of the Ambassador's resignation saying "it should never have come to this".
He said he regretted how an "outrageous leak caused this".
"If I am our next prime minister, the ambassador in Washington stays because it's our decision," Hunt said in an ITV debate the day before Sir Kim's resignation.
The First Minister of Scotland Nicola Sturgeon tweeted that it was "shameful" the diplomat had "effectively been forced out". She said that Boris Johnson's failure in the debate to stand up for Sir Kim "spoke volumes".
The trade union for public servants also reacted on Twitter, posting a statement from the union's General Secretary, Dave Penman.
"Sir Kim Darroch has been placed in an impossible situation, firstly by the leaking of confidential communiques and then by the failure of Boris Johnson and his supporters to provide unequivocal support," the FDA Union wrote on Twitter.
This article is being updated as news unfolds.