Britain's ambassador to the EU has issued a scathing attack on Theresa May and Conservative ministers after quitting ahead of Brexit talks.

In an email sent to his staff, Sir Ivan Rogers called on his colleagues to "challenge ill-founded arguments and muddled thinking" and expressed hope they will "never be afraid to speak the truth to those in power".

The veteran diplomat resigned as Britain's permanent representative to the EU on Tuesday (3 January) to enable a successor to be appointed before the UK triggers Article 50 before the end of March, according to the government.

Rogers had initially been scheduled to leave his post in November 2017 and the timing of his departure, coupled with his parting email, suggests frustration that his advice was falling on deaf ears in Downing Street. Derided as a pessimist by Eurosceptics, Rogers sparked fury last month after warning that it could take a decade to complete a UK-EU trade deal.

In a 1,400 word resignation letter, Rogers said it made "no sense" for him to change his role later this year. He added that it was "essential for all parts of UKRep [Britain's EU representation] to be centrally involved in the negotiations if the UK is to achieve the best possible outcomes.

"Serious multilateral negotiating experience is in short supply in Whitehall, and that is not the case in the Commission or in the Council," wrote Rogers. "The government will only achieve the best for the country if it harnesses the best experience we have [...] and negotiates resolutely.

"Senior ministers, who will decide on our positions, issue by issue, also need from you detailed, unvarnished – even where this is uncomfortable – and nuanced understanding of the views, interests and incentives of the other 27."

He added: "For my part, I hope that in my day-to-day dealings with you I have demonstrated the values which I have always espoused as a public servant. I hope you will continue to challenge ill-founded arguments and muddled thinking and that you will never be afraid to speak the truth to those in power.

"I hope that you will support each other in those difficult moments where you have to deliver messages that are disagreeable to those who need to hear them. I hope that you will continue to be interested in the views of others, even where you disagree with them, and in understanding why others act and think in the way that they do."

Ivan Rogers
Britain's ambassador to the European Union Ivan Rogers is pictured leaving the EU Summit in Brussels on 28 June 2016 Francois Lenoir/Reuters

Rogers' resignation set off a chain of reactions on both sides of the political spectrum, with Eurosceptics hailing it as a golden opportunity to install a keen Brexiteer. "It's not a surprise he's going, he clearly didn't agree with leaving the EU," the former work and pensions secretary, Iain Duncan Smith said.

"I think it's vitally important this is an opportunity not a problem, an opportunity for the UK to appoint somebody who is determined to drive through Theresa May's agenda. So it's a real opportunity to get the right person into the job who actually believes in the UK outside of the EU and is strong enough to be able to get the right kind of deal for the UK as we go forward," he added.

Tory MP and a member of the select committee on exiting the European Union (EEU), Dominic Raab, said: "Sir Ivan is a distinguished diplomat with a long record of public service. He didn't exactly hide the fact that his heart wasn't in Brexit and he was due to step down in the autumn anyway. It makes sense all round to give the ambassador who will see the negotiations through some lead time."

Prominent Leave campaigner Nigel Farage said the prime minister should "welcome it with open arms and put a firm Brexiteer in the position. I think it would be appropriate if a lot more people in that position, British ambassadors, left. The world has changed."

Others, however, lamented the loss of an experienced diplomat. Lord Macpherson, the former senior civil servant who led the Treasury until last year, wrote on Twitter: "Ivan Rogers huge loss. Can't understand wilful & total destruction of EU expertise, with Cunliffe, Ellam & Scholar also out of loop. #amateurism".

Former deputy prime minister Nick Clegg expressed alarm over the series of attacks on public officials who voiced Brexit concerns. "First it was the judges, condemned as enemies of the people for just doing their jobs," he told the Guardian.

"It's been the CBI and any business that didn't sign up to the Brexit zeal, and now it's senior officials being kneecapped in the Brexit press, after Sir Ivan Rogers just gave candid advice about the length of time negotiations might take. They are in the firing line if they do not endorse a zealous world view. This is a very worrying trend, and very new in British politics."