Sir Kim Darroch has resigned as British ambassador to Washington following the leak of his private emails.
In his resignation letter, he said the publication of the memos regarding the Trump administration had made it "impossible" for him to carry on in the role.
He was set to retire in December, but said "current circumstances" meant he must call time early and allow the appointment of a new US ambassador.
The letter, addressed to permanent under secretary at the Foreign and Commonwealth Office, Sir Simon McDonald, read: “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: “I am grateful to all those in the UK and the US, who have offered their support during this difficult few days. This has brought home to me the depth of friendship and close ties between our two countries. I have been deeply touched.
“I am also grateful to all those with whom I have worked over the last four decades, particularly my team here in the US. The professionalism and integrity of the British civil service is the envy of the world. I will leave it full of confidence that its values remain in safe hands.”
Among the leaked messages, sent between 2017 and 2019, was one describing the Trump administration as "inept".
Another questioned whether the White House "will ever look competent".
Responding to the resignation letter, Sir Simon said the British diplomat had acted with "dignity, professionalism and class" in the wake of the "malicious leak".
"You are the best of us," he wrote.
Responding to the news, Foreign Secretary Jeremy Hunt said he was "deepy saddened" that Sir Kim had resigned.
"His career took him from Tokyo to Brussels, from Downing Street - where he became National Security Adviser - to our Embassy in Washington. If one theme ran through all his endeavours, it was his unswerving devotion to upholding the interests of the United Kingdom, in the best tradition of British diplomacy.
"I profoundly regret how this episode has led Sir Kim to decide to resign. He deserves to look back upon his career as a servant of Britain with the greatest satisfaction and pride."