The former head of the Civil Service has said Brexit is not inevitable, and that Britain could still remain part of the European Union if it changes.

Speaking to The Times, ex-cabinet secretary Gus O'Donnell, who was in charge of the Civil Service from 2005 to 2011, said he believed that whatever happened, the UK would also keep in place EU law and rules.

The cross-bench peer said: "Lots of people will say, 'We've had the referendum, we've decided to go out, so that's it, it's all over'.

"But it very much depends what happens to public opinion and whether the EU changes before then.

"It might be that the broader, more loosely aligned group, is something that the UK is happy being a member of."

Before the referendum in June, Lord O'Donnell had said that leaving the EU would be complicated and take "a very long time".

He said in the interview with The Times that leaving would mean "huge administrative and legislative change" because of the vast amount of EU law that had been implemented during the last 40 years.

As a result, he believes that the UK would keep most of the laws in place, even if it did officially leave the European bloc.