The civil service is not prepared for the "enormous job" of taking the UK out of the European Union, Whitehall's former most senior mandarin has warned.
Lord (Gus) O'Donnell said he was "very confident" that Whitehall can meet the challenge by taking on more staff and training up officials, but he said he was worried that Brexit would "crowd out" efforts to modernise the operations of government over a period of many years.
The former cabinet secretary's warning came as the Prospect union said Chancellor Philip Hammond must find more money for the civil service in next week's Autumn Statement to address a resourcing "crisis" if the Government is to deliver a successful Brexit.
The union's deputy general secretary, Garry Graham, said that Brexit was imposing an "unsustainable" burden on Whitehall after years of pay restraint and a shrinking workforce.
The warnings follow an external report earlier this week from accountants Deloitte, which suggested as many as 30,000 extra officials may be needed to deliver Brexit, as well as a report from the Institute for Government which said EU withdrawal was being seen as an "existential threat" to the operation of some departments.
Lord O'Donnell told The House magazine that Brexit was "a tougher task" than any he faced as cabinet secretary and head of the home civil service from 2005-11 or permanent secretary at the Treasury from 2002-05.
Asked if Whitehall was prepared for the task, he said: "There's a very simple, short answer to that, which is No. Brexit imposes a lot of extra requirements on the civil service. They're not perfectly ready.
"Are they capable and in the process of gearing themselves up for it? Absolutely. I feel very confident that they will get there, but it will mean bringing in new people, developing the skills in all sorts of areas and expanding them into other areas.
"I'm confident that they will get there. But no-one should be under illusions - this is an enormous job."
Lord O'Donnell said the task of delivering Brexit would involve not only the departments of the so-called Three Brexiteers - Secretary of State for Exiting the EU David Davis, International Trade Secretary Liam Fox and Foreign Secretary Boris Johnson - but all parts of Whitehall.
"Everywhere will need to be thinking about how this happens," he said. "I have enormous faith in my colleagues that are still there. It's a tougher task than I think any I faced. I wish them well.
"What I worry about is it will crowd out other things - the whole modernisation. We live in a very dynamic world, so the civil service and policy needs to be moving on quite radically during that time.
"I hope that those things won't stop by everyone having to spend their time doing negotiations on our relationship with the EU, the world outside the EU, immigration policies, European Court of Justice stuff, all of that, all huge. It will last for years and years."
Departments will have no choice but to put "a lot of resources" into delivering Brexit, either by recruiting more staff or cutting back on existing programmes. "Government will have to make up its mind which of those it will have to do," he said.
Mr Graham - whose union represents 30,000 civil servants - said: "Even before Brexit, the civil service faced an enormous challenge in terms of the recruitment and retention of skilled staff.
"Our members have seen shrinking take-home pay since 2011, and the outlook is set to worsen with continued pay restraint through to 2020 combined with growing inflation resulting from weaker sterling. This is not the experience of similarly-skilled colleagues in the private sector.
"Against this backdrop - and I can't repeat it often enough - the civil service is at its smallest since the outbreak of the Second World War.
"When you add Brexit to the mix, the situation is quite clearly unsustainable. At the very least, pay pilots must be extended so that we have pay flexibilities across the civil service to retain and recruit the staff we needed to deliver Brexit and the other Government priorities."