A top civil servant has publicly attacked critics of Theresa May’s EU adviser, accusing them of “sniping” at him over his role in Brexit negotiation.

Sir Mark Sedwill, the acting Cabinet Secretary, took the unusual step of writing to the Times in defence of Olly Robbins, who is widely mistrusted by Brexiteers who believe he wants to keep the UK in a close orbit around the EU.

In his letter in Tuesday’s paper, Sir Mark, who is also the National Security Adviser, highlighted a Saturday article about Mr Robbins headlined: “PM’s ‘Rasputin’ has charmed EU and split Tories”.

He said the piece had acknowledged “the extraordinary dedication and professionalism that he and his team have brought to delivering the Government’s Brexit negotiations”.

He went on: “However, the anonymous sources on whose sniping it also draws should be ashamed of themselves, especially in a week when another senior civil servant reported having been threatened because of comments about Brexit implementation.

“This has to stop. Civil servants have always trusted that our fellow citizens, whatever their views, know that we are doing our duty to implement the decisions of the governments they elect.”

Sir Mark later posted a link to the letter on Twitter, saying he had been “defending our Brexit team, and the values of the dedicated and impartial public service of which I’m proud to be a member”.

Mr Robbins is reputed to be the only person in Whitehall to fully grasp the complexities of the British negotiating position.

But Brexiteers have accused him of trying to engineer the softest possible break with the EU.

Some in the Leave camp believe he was the true architect of the Chequers plan, drawn up in the Cabinet Office while David Davis and other Brexit ministers were kept in the dark.

Mrs May’s official spokesman said: “It is one of the roles of the Cabinet Secretary to uphold public trust in the integrity and impartiality of the civil service.”

The PM’s spokesman said Sir Mark’s letter was approved by 10 Downing Street.