A Brexit deal will take at least five years to hammer out, the former head of the civil service has warned, as he told senior ministers to stop "briefing against each other".
Gus O'Donnell, who served as cabinet secretary to Tony Blair, Gordon Brown and David Cameron, said leaving the EU was the toughest challenge a British leader had faced in his memory.
Lord O'Donnell said "there's not a chance" of sorting out a final deal in two years.
"We certainly won't have come to any final arrangement in two years' time. We might well get to a point where we can symbolically leave, but all sorts of details will still remain to be sorted out," he said.
"So, we'll have got some arrangement whereby we can say, 'Right, from now on we're no longer going to be governed by the European Court of Justice, we are no longer going to be sitting around the table doing any of these things.'
"But, it would still be unclear, precisely, what the deal will be for all sorts of parts of goods and services for our trade, and it certainly may well be unclear about what access we might have to their markets.
"The idea that you can manage this carving out of a new relationship between the UK and in the EU in 18 months, let alone two years - there's not a chance, there never was a chance.
"But that's not to say we can't have symbolically left, but it just means we have got to get out heads around the idea that leaving could be a symbolic act. Lots and lots of the details will still remain to be sorted out, so the uncertainty will not have gone away.
"I can imagine it taking at least five years to get through all of the details, and I imagine some of the transition arrangements may be longer than that," he told BBC Radio Four's The Westminster Hour.
Lord O'Donnell warned the UK faces "very negative" negotiations in Brussels as the remaining major EU states try to put others off leaving the union by showing it "has cost us something".
He said: "It's very difficult round the Cabinet table to get two groups who have been in completely different positions together.
"They've been on different sides of an argument, and one side has clearly won, and now they all need to get together, work as a team, try very hard to stop briefing against each other, and get on and deliver a clear strategic plan and then get the best deal for the country."
Theresa May's Government has been plagued by rumours of Cabinet splits over its approach to Brexit and whether membership of the single market and customs union should be prioritised over immigration controls.
Lord O'Donnell said the scale of the task should not be underestimated.
"There are some people out there still saying this is completely straightforward and you can do it overnight", he said.
"Ministers like (Brexit Secretary) David Davis - who I have a lot of respect for - are realising precisely how difficult all of this is.
"Everything will be geared towards fulfilling the Brexit mandate and we wont get much happening in other areas."
He also criticised the decision to create a whole new department for exiting the EU, and said the co-ordinating role should have been given to the existing Cabinet Office.
He said: "Machinery of government changes are cumbersome and create all sorts of issues about setting up offices and computer systems and new ministers in new departments.
"So frankly I'm in favour of trying to use the machine you've got rather than redesign the machine because that takes time."
And he warned that leaders seeking election in France and Germany are likely to give the UK a tough time in talks.
He said: "I think initially it will be very negative because if you are incumbent governments in say France or Germany, you want to prove that leaving the EU is not a good idea, you'll want to show that leaving has cost us something."
There may be more "give and take" after the elections, he said.
Striking deals on goods would be "relatively straightforward", but reaching agreement in agriculture, financial services and controlling free movement will be "very difficult", he added.
A government spokesman said: "As the Prime Minister has said, the Government is calmly and carefully getting on with the job of preparing for the forthcoming negotiations.
"Departments are already working closely together to ensure the best possible outcome for the British people."