TEXT-Resignation letter of British ambassador to Washington

LONDON, July 10 (Reuters) - Britain's ambassador to Washington resigned on Wednesday after Donald Trump labelled him "stupid" and "wacky" following the release of confidential memos from the envoy in which he branded the U.S. president's administration inept.

Below are extracts from Kim Darroch's resignation letter and the response from the head civil servant at Britain's Foreign Office.

KIM DARROCH

"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.

"I am grateful to all those in the UK and the U.S. who have offered their support during these 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 U.S. 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."

RESPONSE FROM SIMON MCDONALD

"On behalf of the Diplomatic Service, I accept your 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.

"The Prime Minister, Foreign Secretary and whole of the public service have stood with you: you were the target of a malicious leak; you were simply doing your job.

"I understand your wish to relieve the pressure on your family and your colleagues at the Embassy; I admire the fact that you think more of others than yourself. You demonstrate the essence of the values of British public service." (Reporting by Andy Bruce; editing by Stephen Addison)