Cameron considered clinging to power after losing the historic vote, but decided against it because it would leave him 'being prepared for the slaughterhouse'.

He begged her to 'come off the fence' over Brexit – but she refused so often that one of Cameron's allies questioned if she was secretly 'an enemy agent'.

Another accused her of leaving Cameron to 'fight alone'. No 10 became so fed up with her habit of disappearing when Cameron needed her that they nicknamed her 'Submarine May'.

No10 became so fed up with Theresa May disappearing during the Brexit campaign they nicknamed her 'Submarine May'

The bombshell disclosures come in a new book by Cameron's Downing Street director of communications, Sir Craig Oliver. It reveals how Boris Johnson, now Foreign Secretary, reassured Cameron in a secret text that Brexit would be 'crushed' – nine minutes before putting himself at the head of the Leave campaign.

Twenty-four hours earlier, 'depressed' Johnson had sent another message which convinced Cameron he was about to 'flip-flop' and back the Remain camp.

It also discloses how 'political suicide bomber' Michael Gove went back on a pledge made to Cameron at a family gathering at Chequers at Christmas to stay loyal to him in the referendum.

And it is revealed that Cameron considered clinging to power after losing the historic vote, but decided against it because it would leave him 'being prepared for the slaughterhouse'.

Oliver, 47, a former BBC news chief, was at Cameron's side from 2011 to the day he quit over Brexit.

His book, Unleashing Demons, is the first insider's account of the historic events that led to Cameron's downfall. It reveals how:

- May failed to support Cameron on 13 separate occasions;

- She did reluctantly 'come off the fence' but only after a 'visibly wound-up' PM telephoned her during a train journey to give her a dressing down – then 'hung up' on her;

- He predicted her 'Sphinx-like' antics could make her Prime Minister in six months. She beat his forecast by two weeks.

- One of her excuses for not backing Cameron was that she wanted a weekend break with her husband Philip.

The disclosures are at odds with Mrs May's reputation for straight talking.

Exit: Craig Oliver with David Cameron the day after he resigned, on June 25

Johnson fares equally badly in the book, which says that moments before he publicly vowed to lead the Leave campaign, he texted Cameron to say Brexit would be 'crushed'. This newspaper can reveal that Johnson's text said Brexit would 'be crushed like the toad beneath the harrow' – adapting a phrase used by Rudyard Kipling in a famous poem.

And the book reveals how Johnson had a secret last-minute wobble about leaving the EU. In between two phone messages saying he would back Brexit, he sent a hitherto undisclosed third message saying 'depression is setting in'.

Jubilant Cameron believed 'confused Inner' Johnson was going to back him after all. He was wrong.

The claim that Cameron believed Johnson never really backed Brexit comes after a similar comment by Johnson's Foreign Office deputy, Sir Alan Duncan.

Like Duncan, Oliver suggests the Brexit stance of 'cavalier and reckless' Johnson was a ploy to boost his hopes of becoming PM.

Oliver's book savages Gove, accusing him of betraying his personal friend Cameron in the referendum and then Johnson in the subsequent Tory leadership contest.

Cameron was so angry with 'deceitful' Gove's attacks that he threatened to denounce him publicly on television, raging: 'I'm going to lose my temper and unleash one on these people on live TV soon.'

According to Oliver, Gove's wife, the writer Sarah Vine, had assured Cameron at Chequers over Christmas that her husband would be on his side in the referendum.

When Gove set his own sights on No 10, Cameron questioned his mental fitness, saying that he was 'prone to infarctions' – or seizures. 'Can you imagine him ever being left in charge of the country?' Cameron demanded.

Oliver says he never trusted Gove, whose 'legendary politeness seemed forced for someone so skilled at dinner party assassinations'.

He says Gove told George Osborne that Brexit would cause 'scarring and burning' to the economy. When Gove's leadership bid crumbled after he 'cut Boris off at the knees', Oliver says: 'He failed to realise that in acting as a suicide bomber, his first victim would be himself.' His 'fatal flaw was vaulting ambition and a preparedness to mislead'.

In his vivid and searingly honest eyewitness account, Oliver admits Cameron made mistakes in the referendum. But he says he was badly let down by 'submarine' May.

Oliver writes: 'It's the biggest thing the PM has faced and he doesn't even know if the Home Secretary is backing him.'

The book solves the mystery of May's sudden and strangely muted public declaration of support for Cameron over the referendum. He effectively held a gun to her head after she declined to back him at EU talks, claiming she was away for the weekend with her husband.

When Cameron heard the next day that she was threatening to back Brexit, he phoned her and demanded she back him – and 'hung up,' satisfied he had 'made an impact on her'.

A chastened May rushed out a statement offering modest support – then went back to stonewalling.

Oliver offers grudging respect for her, saying: 'In terms of pure politics, she played it well, having her cake and eating it, but it doesn't seem fair on the PM who has treated her well.' Similarly, he praises Johnson's 'rock star' appeal and Gove's 'brilliance and wit'.

In emotional scenes in No 10 as defeat loomed, Osborne urged Cameron to stay on, arguing history was 'littered with governments that survive torrid times'.

Cameron rejected the advice, replying: 'I'd be saying, 'come and punch me as hard as you like.' ' In return, Cameron was loyal to his Chancellor to the last. Told that if he won, he might survive but some would call for Osborne's head, he said they could 'get stuffed'.

When the Brexit victory was confirmed, a dazed Oliver lurched out of Downing Street into Whitehall where he 'retched'.

When Oliver saw Cameron the morning after the vote, the PM said simply: 'Well, that didn't go to plan!'

It's the book that will set Westminster ablaze - Cameron's right-hand man reveals in explosive detail what REALLY went on inside No10 during the Brexit battle and how it descended into...BRUTALITY BLOODSHED and BETRAYAL

As David Cameron's No 10 Director of Communications, SIR CRAIG OLIVER had a unique insight into the EU referendum campaign. Former BBC news executive Oliver, 47, kept detailed diaries throughout.

In this first part of today's serialisation of his book, Unleashing Demons, Oliver describes the high drama inside No 10 on the night of June 23 as it dawns on shocked Cameron and his team that they are doomed to defeat.

Thursday, June 23

Referendum day. 7pm.

I arrive at No 10 and walk upstairs to discover civil servants, special advisers and politicians mingling in the staterooms. The PM is there, looking relaxed in a casual shirt that isn't tucked in. A long table is laden with moussaka and lasagne. Wine and elderflower cordial are served.

Bruised by a brutal campaign, I have felt confident of victory all day, but am beginning to feel uneasy now. However, the mood is good.

He gets to the final sentences about loving his country and begins to choke up, just about getting to the end without crying

Two polls come through suggesting it'll be about 52-48 for Remain. Close, but I'll take that. There isn't a single indicator suggesting we should be worried.

When the results are due to start coming in, I decide to watch by myself in my office. Newcastle isn't as good for us as it should be. Sunderland was always expected to vote Leave, but 61 per cent to 39 per cent is far worse than predicted.

Sterling plummets. I feel a wave of sickness wash through me. A few more results trickle in.

I text Ryan Coetzee, the Remain campaign's Director of Strategy: 'What do you think?'

Ryan replies: 'We're just very slightly behind the curve. By a point, basically. It's looking too close to call. In fact it's very f****** close.'

It's going to be a long night. I doze for a few minutes and wake up to see more results tumbling in. The lead is switching back and forth. Big London numbers pull us back – but then there are a series of smaller, bad results.

The BBC has designated Leave the colour blue and Remain yellow. A pattern begins to emerge as results flash on the screen: Blue. Blue. Blue. Then we are pulled back by a massive Remain result.

Blue. Blue. Blue. Blue. Blue. Yellow. Blue. Blue. Blue. Blue. Blue. Yellow.

I call Ryan. 'We are just on course for a win,' he says. 'But it's going to be tiny.'

'How tiny?'

'The model is currently predicting we will win by 32,000 votes.'

Christ…

David Cameron texts me: 'How worried should we be?'

I reply that it's desperately close – we just have to see.

The results start piling in at 3am. The BBC says that it is precisely 50-50. The sensation is one of, having been sure of my path, stepping into quicksand and being slowly pulled under. I look around for something or someone to help pull me out. But there's nothing and no one. I call Stephen Gilbert, the Conservative Party's former campaign chief, who has played a key role at Stronger In. I try to make it easy for him. 'It's not looking good, is it?'

'I can't see us doing it now – no.'

Lucy Thomas calls me from the Stronger In party, close to tears, as she tells me: 'ITV is going to call it for Leave.'

'Stay on as PM? It would be miserable. Every moment I was here I'd be being prepared for the slaughterhouse' was what David Cameron said after the Brexit result

It's approaching 4am. DC's press secretary, Graeme Wilson, slaps me on the back and says he's going to bed. 'It's over.' I borrow his coat. I need some fresh air. DC is standing outside his private office. He looks tired. Resigned in every sense. The Cabinet Office Minister, Matt Hancock, and the Prime Minister's long-serving aide, Liz Sugg, are nearby. He waves us inside and slumps into the armchair he's used to chair thousands of meetings over the past six years.

Yesterday [June 23], at a meeting of the PM, George [Osborne], Ed [Llewellyn, Downing Street chief of staff], Kate [Fall, deputy chief of staff], Oliver Letwin and me, we had talked through the options if we lost.

Option 1: Resign, hanging on until the party finds a new leader.

Option 2: Stay on to steady the ship, without giving a specific date for going.

I said: 'We tell ourselves that a win is a win, allowing us to do what we want. But we also need to understand that a loss is a loss… If you lose and stay on, you will be fighting reality.' DC nods. I know he has already made up his mind to go. George went next: 'History is littered with examples of governments that have been through torrid times only to survive.'

DC had laughed, saying: 'Prime Ministers also resign.'

There was some pushing back and forth. I felt tears welling in my eyes at one moment.

DC went out to the loo. I reminded everyone of the knight in Monty Python And The Holy Grail, taking hit after hit, having limbs sliced off – yet still urging people to try to beat him, claiming: 'It's only a flesh wound.' In other words – he doesn't know he's beaten.

Oliver Letwin considered what would happen in a Conservative leadership election. He thought it would include Theresa May, Boris Johnson and Michael Gove in a competition on who could be the most 'Leavist', with Gove the only one who really believed it. Could Gove cope? DC says he is prone to 'infarctions' [seizures].

Kate had raised the prospect of us winning, only for them to still demand George's head. DC's view was that they could 'get stuffed'. Everyone feels protective of George, who has given his all.

Boris and Gove hold a press conference and it comes on the television. It looks more like a funeral to me than a celebration, said Craig Oliver

Now, in the early hours after the defeat, the PM says he's been thinking about whether he should be less specific about when he goes, but doesn't think it will work. I say: 'I may be wrong but I can't see how you can stay.'

DC says: 'The trouble with all options other than going immediately is they collapse like a concertina. And the truth is, I wouldn't believe in it.' Liz asks if, given that he told people he would stay on, resigning now will be seen as a betrayal of trust. Both DC and I are touched by this – everyone knew it was a question he had to answer that way but no one will really be shocked at the change.

The simple fact is that he couldn't be responsible for delivering Brexit when he doesn't believe in it.

The PM says: 'It would be miserable. Every moment I was here, I'd be being prepared for the slaughterhouse – just waiting for the tap on the shoulder.

'I'd be saying, 'Come and punch me as hard as you like.' And then I'd have to go.'

He starts to move to the door. I can't think of anything to do other than slap him on the back. He says: 'Don't worry…'

Results come in - it's like stepping into quicksand and being slowly pulled under with no one to help me

I watch him disappear down the corridor. I walk out on to Whitehall. The street is deserted. My mind feels calm but as I approach the memorial opposite the entrance to the Ministry of Defence, my body seems to go into spasm. I suddenly retch harder than I have done in my life. Nothing comes up. I retch again – so hard, it feels as if I'll turn inside out.

Dots of light dance before my eyes. And then it is over. I spit. Tears are streaming down my face – not from sadness, but from the sheer physical exertion.

At 4.39am, I'm back in No 10 to watch David Dimbleby call it formally on the BBC. The pound is dropping to its lowest level since 1985. A small voice inside me is saying: They broke it, they own it.

I walk into No 11. George is sitting alone, watching a tiny television. I put my hand on his shoulder and ask him how he thinks Michael Gove and Boris Johnson feel.

My hope is that they feel real pain, wondering what on earth they have done. George pricks that bubble, simply saying: 'Cock-a-hoop. In politics you always believe you'll be better than those who went before you.'

DC arrives in No 10 at about 7am, trying to have a sense of humour about it all. 'Well, that didn't go to plan!' he says.

He calls Gove and takes charge immediately: 'I wanted to call you to formally concede and to congratulate you on a stunning victory.'

'Thank you, PM.'

'From here on, I'm keen to provide stability.'

'There are some particular things we should talk about regarding how the negotiations proceed.'

DC cuts him off at the pass. 'I'll make a statement shortly. It'll really just say: Result received and accepted and it must be delivered.'

He sounds friendly, though I detect some cold brutality. 'All right, take care.' I can hear uncertainty in Gove's voice – what is DC planning?

Others who listened to the call are incensed. 'Did you hear him – as if he was the PM dictating terms?'

Just after 8am, DC goes out.

I turn up the TV. The office is full of people. George stands next to me. Kate Fall is in tears. It's obvious from the moment he walks out of the front door that he is resigning. Sam wouldn't be there if he wasn't going.

He gets to the final sentences about loving his country and begins to choke up, just about getting to the end without crying.

Thirty seconds later Sam and he are back in the office. A spontaneous round of applause goes on for well over a minute.

DC makes a short speech about this being the best team he could hope to have. He gives me a big hug and I feel the tears well up in my eyes. Sam hugs me too. 'Craig…' she says, and there's no need to fill in the blank.

Later, I am in a pub in Smithfield with some of the Stronger In team when Boris and Gove hold a press conference and it comes on the television. It looks more like a funeral to me than a celebration. I walk out before Gove speaks. I don't think I can stand his fatuous nonsense.

When the Cabinet meets on Monday [June 27], I look across at Gove. His face is crimson, looking like he may be about to have a coronary. He seems to be engaged in the most elaborate performance.

He grabs his pen with excessive vigour, scribbles and underlines ferociously. When he turns the page, he takes the fabric bookmark and lays it down along the spine of the notebook with excessive care. Occasionally he places his elbows on the desk, his palms pressed against each other and drums his fingers together, varying the tempo. No one else is so fidgety.

DC rattles through some points about this being a clear instruction from people and there being no Brexiters or Remainers any more, just one Government.

He adds that people think the party conference is a natural break for the new leader to be in place – some think longer, some shorter – but says: 'I'm not particularly fussed!'

Various people contribute. Theresa May notably does not pay tribute to the PM. She speaks in her usual no-nonsense way about the need to 'competently and practically' get the best result.

Gove gives an effusive tribute, saying history will be generous to DC. He says: 'We need to be unified in stopping those who seek hate and division.'

There's then some guff about needing to work together.

He looks like a seagull holding a fish in its beak that is too big to swallow – eager to keep hold of it, but also not sure it can carry the burden…

'Silent submarine' Theresa seized the leadership by stealth: Mrs May and the ploy that saw her win power

As Cameron returns to work after the New Year, he resolves to find out which Ministers he can rely on to back him over the referendum. The key Cabinet figure giving him particular concern is Home Secretary Theresa May.

MONDAY, JANUARY 11

A major focus of the week commencing Monday, January 11, is who would be 'In' (with the PM) and who would be 'Out' (against him) in the event of a successful renegotiation [of the terms of the UK's membership of the European Union].

Conversations keep circling back to what Home Secretary Theresa May will do. Some feel her past speeches would make it hard for her to go 'Out'.

The PM believes authenticity would be a problem for her, so she won't do it – if you take a position that isn't where your instincts lie there's a real prospect of being 'smoked out'.

However, a discussion in Tuesday's Cabinet meeting about the importance of remaining a united party throughout the referendum campaign is interesting because of who does not speak – Theresa, playing her cards very close to her chest.

Amid the murder and betrayal of the campaign, one figure stayed very still at the centre of it all – Theresa May

Afterwards, some of the team want to discuss her. Her sphinx-like approach is becoming difficult, with the press questioning which way she will jump. The conversation turns around this being the biggest thing the PM has faced and him not even knowing if the Home Secretary is backing him.

Some think she is heading Out; others that she's relishing keeping us guessing; others that she simply can't make up her mind. Apparently DC is worried she does not realise she would be a central figure in any future Government of his, and wants to communicate that to her.

At the weekend, I call the PM as he is on his way to the constituency, and ask how this chat with May went. I can tell he is frustrated. It sounds like she refused to come off the fence. From her point of view it's a smart strategy, trying to demonstrate she is her own person, allowing her to have her cake and eat it, but it doesn't seem fair on DC, who has treated her well.

DAVE FEELS THE SQUEEZE When the PM does the BBC's Andrew Marr Show on January 10, the programme is played out by Squeeze singing a song called From Cradle To Grave. When they are done, the PM applauds and the show is over. I think the band seem remarkably frosty to him. It soon emerges they've changed the lyrics of the song to complain about the destruction of the welfare state and council houses. 'Of course, all of them live in council houses,' says the PM sarcastically when I tell him. Advertisement

Later that month, while in Davos in Switzerland, my phone comes alive with texts from London. May has been seen lunching in Westminster with the leading 'Outer' Liam Fox at Quirinale. The hacks say it's the kind of restaurant you go to if you want to be seen, and clearly feel she is playing games. I ignore attempts to get us to comment.

At the end of January, on a plane to Brussels, the conversation turns to the fact that the Home Secretary still hasn't told us where she is going: leading the Out campaign, or sticking with us. DC looks wistfully out of the window and says: 'Well, it may work for her. She could be PM in six months' time.' [May officially became Prime Minister on July 13, five and a half months later.]

At the beginning of February, as we are racing towards the first draft of the negotiated settlement with the EU being released, I have a hilarious meeting with May's Home Office special advisers.

I say it will be a key moment for Theresa to make the case for Remaining. One of the advisers blurts out: 'Theresa will be away that week!'

'Yes, but she'll be back on the day. We'll need to get lots of voices out.'

'She's going away that weekend with [her husband] Philip!' is the rushed response after a couple of seconds of thinking time.

'Yes. But she'll be back on the Monday, and that will be a crucial time,' I continue patiently. They assure me they're more than willing to help and will get back to me.

David Cameron predicted her 'Sphinx-like' antics could make her Prime Minister in six months. She beat his forecast by two weeks

'INTOLERABLE' HILTON I ask the PM what it's like having Steve Hilton [formerly one of Cameron's closest aides] out there attacking him. It sounds to me as if DC really won't have anything more to do with Steve, who has been highly critical on his current book tour. The theory in Downing Street is that he never got over the fact that the PM was prepared to let him go so easily. Life had become intolerable, with Steve (right) falling out with civil servants and apparently behind briefings that DC had betrayed their core mission. When he disappeared, the ship settled and we won a General Election. Advertisement

The following day, the front page of The Times looks briefed by people close to May. It says DC 'faces last-minute opposition from her to a compromise on migration'.

May wants, among other things, Brussels to close a back door route into Britain that's being used by migrants from outside the EU. The report says it's leading to fears in No 10 that she could refuse to back the reform deal.

Later, on a train to Chippenham for a speech, DC is visibly wound up by the report.

Suddenly he picks up his mobile and calls May, asking her to make clear we have been victorious in our plan to crackdown on 'swindlers and fiddlers' attempting to come into the UK.

When he hangs up he seems to think he's made an impact.

Later the Home Secretary issues a statement saying she believes there's 'the basis for a deal here'.

This is interpreted as the moment she climbed down off the fence. After all the concern around her, it all seems to have ended not with a bang, but a whimper.

In Brussels in mid-February for the crunch renegotiation summit, I make sure we have enough Cabinet Ministers ready to do media over the weekend if a deal is done.

May could add a lot of force but we are getting reports that she is unprepared to help, saying that it would be awkward for her because immigration numbers are coming out next week and she will face difficult questions. The fact is, I am worried that if the issue is forced she will say something unhelpful.

On Monday, March 7, I go for a meeting with May in her office suite in the Home Office. We discuss the fact it would be good to have an intervention from her soon. The PM is looking like he is the only one out there fighting the campaign. She nods and agrees that later in the week she will be asked about Europe and she will be categoric in expressing her view. She wants to give a full speech 'after Easter', but we settle on next week. 'After Easter' feels like an eternity away.

In terms of pure politics you have to hand it to her, she is playing it well. She is on the right side making clear she is 'In', but not looking overly enthusiastic. It's making life uncomfortable for us.

BORIS THE BULL In a No 10 conference call, I ask George about the previous day's newspaper pictures of him with Ruth Davidson on a farm. One is a low-down shot of both of them literally shovelling s**t. George says they also stood next to a bull with a broken penis – prompting Ruth to shout: 'Let's call him Boris!' Advertisement

In April, there's another big push to get May out there. She's agreed to do a newspaper article on Sunday April 24, BBC1's The Andrew Marr Show, and a speech on security. I call her special adviser on the Thursday before to find out more. She immediately says: 'I'm so sorry. Theresa just doesn't feel able to do the article, she doesn't feel she's had time to think through the arguments.'

I don't even bother to argue back, it's so predictable. I write an ironic email, entitled 'Shock News' to the team to let them know she's pulling back.

That Sunday, I wait to hear from May's team. We have agreed they will be giving the media part of the speech she is giving tomorrow. It's standard to run these things through No 10 so there are no surprises.

Come 4.15pm we have seen nothing. I make some calls to ensure they send it.

When I read it, alarm bells begin to ring. It starts well: 'She will put forward a positive case for reasons to Remain.' But there are phrases in there which will be catnip to journalists suspecting she isn't fully signed up.

'The Home Secretary will call for a more mature debate which acknowledges the complex challenges that lie ahead.' She does not want to 'insult people's intelligence by claiming that membership of the EU is wholly good, or that the sky will fall in if we vote to leave.'

That will mean the story will be all about the Home Secretary chiding the Remain campaign for its approach and saying it's a fine decision between staying and leaving. Not helpful.

I call the PM, who is mowing the lawn at his constituency home. He sees the point.

After a lot of negotiation, it's agreed a version without the 'sky falling in' line goes out.

The next morning we discover the whole of her speech has been briefed to the press so that it can't be changed. Will Straw, the Remain campaign director, texts me: 'Are we sure May's not an agent for the other side!?'

Leaving No 10 one evening, Theresa is just ahead of me. I have a feeling that with all the Conservative warring, she could come out of all of it very well.

RUTH'S RATHER BLUNT QUIP I call Ruth Davidson [Tory leader in Scotland] to say we spotted how well she did in the Scottish debates and we need her to do the massive Wembley Arena debate at the end of the campaign. She's immediately up for it. When I tell her Angela Eagle is also being considered for the team, she gets straight to the point: 'Angela and I are very similar. Are you sure you want two shovel-faced lesbians?' Later Ruth (right) says I responded like an embarrassed Hugh Grant, muttering and bumbling. Advertisement

By mid-June, it's clear to me that whatever the outcome of the referendum, we'll be out of No 10 quite quickly. I don't see how the PM can survive. I mention this to Kate Fall who doesn't even blink, describing the current situation by saying: 'Oh yes… this is the burning of Moscow stage.'

DC disagrees. He is clear that we will be able to steady the ship and continue. A win, combined with a strong will, will see us through.

On Wednesday, June 15, completely against my advice, May does an interview with the BBC. Whether it's by accident or design, she has reopened the debate over whether we need to do more about freedom of movement.

I find it frustrating. It would be better if she stuck to her submarine strategy of disappearing from view. This is starting to spin badly out of control. We are being knocked about by indiscipline from all sides in this ramshackle coalition.

On Referendum Day, I arrive at No 10 to be informed that Theresa, who has spent this entire campaign avoiding media where possible, is now keen to do the high-profile 8.10am slot on the next morning's Today programme on Radio 4, once we know the result.

We've already told the BBC that the Defence Secretary [Michael Fallon] is doing it but May's team is trying to set it up behind our back.

After the Prime Minister's resignation, Boris pulling out of the leadership contest, and Gove being knocked out, it becomes a battle between Theresa and Andrea Leadsom. Then Andrea appears to suggest she would be a better leader because she has children and May does not. It leads to Leadsom's withdrawal.

Amid the murder and betrayal of the campaign, one figure stayed very still at the centre of it all – Theresa May. Now she is the last one standing.

Revealed: The dynamite text in which 'flip-flopping' Boris Johnson told Cameron he thought Brexit would be crushed

Speculation over whether Boris Johnson will back Cameron or put himself at the head of the Brexit campaign is at fever pitch. Anxious Cameron is in No 10 awaiting news of Johnson's intentions.

Saturday, February 20

D-DAY FOR BORIS

I go into a small group meeting in No 10 with the PM, George Osborne, Kate Fall and Ed Llewellyn. DC's trying to frame what he wants to say to Cabinet when he looks at his BlackBerry. He takes some time to read a message, elbows on his knees, glasses on the tip of his nose. With a resigned look, DC says: 'Well… it looks like Out.' In fact, the email left no room for doubt – it's clear Boris is going for Out.

He then reads it out. It begins by saying how he has been a tortured soul, but he has to 'go with his heart'. There's a real concern that what he calls a 'hate machine' will try to destroy him after taking this decision, saying there are plenty out there who will want to attack, 'some of whom will earn good money'. He suggests at the end that he thinks we will end up staying in.

There's a moment when we absorb what has happened. Some look sick, others resigned. Some wonder if we should leak it. I am clear we should not. We don't want to wind Boris up by starting a war and stealing his thunder. That will detract from our message and anger MPs.

I am struck by two things: Boris is genuinely in turmoil, flip-flopping within a matter of hours; and his cavalier approach

Four hours after the initial message, at around 1pm, I get a call from DC, by now at his home in Witney, to make sure I am stopping anyone tempted to reveal that Boris sent a message saying he will support Leave. The reason is there's been another text suggesting he might change his mind and back Remain. I'm struck by how reckless Boris is being – we could just blurt all of this out at any time. His big moment could end with him badly tarnished.

I ask DC what makes him so sure Boris is wobbling. He reads out some parts of the text including the phrase 'depression is setting in', followed by a clear sense that he's reconsidering. Neither of us is left in any doubt.

I am struck by two things: Boris is genuinely in turmoil, flip-flopping within a matter of hours; and his cavalier approach.

He must understand that the stakes are even higher for DC than for him. So why is he unburdening himself in this way to the man who could be so damaged if he chooses to go for Leave?

The PM says: 'If he is in that much doubt the logical thing to do is go with the status quo.' Others are less charitable, questioning his motivation. The following day, the frenzy over Boris being about to announce his intentions reaches fever pitch.

He comes out just before 5pm with a typically chaotic press conference outside his home and announces he will be supporting Leave. All the key journalists are waiting – and must have been warned something was up a while ago. I get endless calls about when the PM knew. Boris's team say he informed DC on Saturday morning. That's true, but they are missing out the subsequent wobble, which we didn't disclose.

I call the PM. He received a final text from Boris just nine minutes before he told the world. This makes it tricky for us in terms of letting people know what really happened. We agree I should say: 'The final confirmation to the PM was made shortly before the announcement,' though I won't reveal the wobble. If pressed, I do reveal that final text came in the quarter of an hour before the press conference. Again, that doesn't reveal there was a wobble.

Many in No 10 are smarting, annoyed that there has been so much dithering over something so crucial. A few believe it's little more than a straightforward political calculation to ensure Boris has the best chance of sitting in No 10 in just a few months. Many refuse to believe that he is even an Outer, because much of his argument seems to be that voting Leave need not mean leaving, but another opportunity to renegotiate better terms and have a second referendum.

Many refuse to believe that he is even an Outer, because much of his argument seems to be that voting Leave need not mean leaving, but another opportunity to renegotiate better terms and have a second referendum

Late on, DC calls me just as I flop on to the sofa exhausted. He tells me that Boris's final message was clear he doesn't expect to win, believing Brexit will be 'crushed'. He says Boris is really a 'confused Inner', and their previous conversations confirmed that view to him, with discussions about tactics to get the best possible deal. 'He actually said he thought we could leave and still have a seat on the European Council – still making decisions.' The bottom line is, this is the new reality. It will be a proper fight now, with the papers billing it as a 'Clash of the Titans' – the two biggest Conservatives locked in mortal combat.

One day in the middle of May, I sit round the fringes of political cabinet and observe Boris's body language. He looks exhausted, his wide, pallid right hand spreadeagled across his face. I wonder if he is asleep.

The PM has been irritated by Boris attempting to make hay with the leaked Serco letter [a letter from the FTSE 250 company has been portrayed as part of a conspiracy – big business working with Government before an EU deal was done], coming close to accusing the PM of being corrupt. Michael Heseltine does an interview with the BBC and does not spare Boris. It is a relentless takedown.

But by the end of the month, I worry we are in serious trouble because of the blue-on-blue soap opera. It's not that I think we're going to lose, it's more we may not be able to move forward if we win.

DUNCAN'S IMMODEST MEMO When Sir Alan Duncan comes out as a Remainer, he drafts a statement he thinks we should use. It says: 'In a major blow to the campaign to leave the EU, senior Tory MP Sir Alan Duncan has today announced we should remain a member. As one of the few undeclared MPs, he is seen as an experienced and reasonable figure of influence. 'Known as a longstanding but thoughtful Eurosceptic, his declaration will be seen to have a pivotal bearing on the many voters who are still undecided. 'To have won over such a senior and experienced political figure will be seen as a significant coup both for the Prime Minister and the campaign to remain, all the more so as Alan Duncan is seen as independent-minded and someone who cannot be pushed around.' We tell him: 'Maybe it needs a little rewriting.' Advertisement

Gove and Boris have written an open letter to the PM, criticising him for clinging to his pledge to cut net migration to the tens of thousands. They say he's 'corroding public trust'.

It feels like an act of war, motivated by an intention to kill. It's intensely personal, effectively accusing the PM of a lack of integrity. We would hesitate to say it about a leader of the Opposition, let alone someone in our own party.

DC thinks it 'depressing beyond belief' and 'deeply maddening'. Some of my colleagues are angry that Gove is part of a Government that has this as its policy and Boris stood on it as part of the manifesto and yet they are attacking it. I understand their position, but also think it's like calling men out for visiting a brothel by saying they are supposed to be Christians.

The following day, the Sunday papers are ugly. There is an evening meeting at the PM's home in Oxfordshire. DC says: 'People keep saying they think it will be all right – but I'm very worried.'

He runs through our response options to the Gove/Boris letter:

1: Be Zen, refuse to rise (as we are now).

2: Fight back.

3: Call out their strategy. We know what they're up to and won't fall for it.

He chalks off number 2 as making things worse. I'm reminded of the saying, 'Don't wrestle a pig. The pig likes it and you get covered in s**t.'

He also thinks 3 doesn't work because it's too clever. Which takes us back to 1. The next time they say anything, we call it 'increasingly desperate' and move on.

On Tuesday, May 31, the Leave campaign briefs they would stop the EU imposing VAT on fuel bills, saving the average consumer £60 a year. It removes any doubt that Leave is setting itself up as an alternative Government, complete with their own policies to be enacted should Cameron and Osborne lose. The words 'attempted coup' spring to mind. Others at No 10 agree.

Then on Saturday, a 2,000-word letter signed by Boris and Gove is full of claims about Turkey joining the EU and how there'll be 300,000 more jobs if we leave. It's the most deceitful thing they've tried so far.

At a meeting with the PM during the week, I slump on the sofa outside his office next to George, who is sniggering as he reads a piece by Matthew Parris who says of Gove '… when he grows eloquent I cannot quite banish from my nostrils the smell of burning witches'. George and I are unable to stop laughing.

After the referendum, I'm watching Boris's speech on Thursday, June 30, in which he is expected to announce he is a Conservative leadership candidate. He tells his audience he has concluded he cannot be leader. There's an eruption in No 10. Someone texts: 'OMFG!'

Gove announces he is standing. It's either an act of extraordinary chutzpah, or it reveals a basic failure to understand that people will be horrified by his behaviour. The man who told everyone he believed in Boris enough to be his campaign manager, now effectively saying it was a terrible misjudgment. As Boris prepared his speech that morning after Gove had cut him off at the knees, his world must have felt as if it was crumbling around him.

In the leadership campaign, many finally saw the personal ambition and willingness to deceive they had not spotted in Gove before.

Adapted from Unleashing Demons: The Inside Story Of Brexit, by Craig Oliver, published by Hodder & Stoughton on October 4, £20. Order your copy for £16 (20 per cent discount, including free p&p) at www.mailbookshop.co.uk or call 0844 571 0640 until October 16.

Gove? He acted like a suicide bomber

At the beginning of February, DC still seems utterly confident Gove is onside. Gove and his family stayed at Chequers during the Christmas break. The question of whether Michael would be 'In' or 'Out' hung heavy in the air. DC had several conversations with Sarah Vine [Gove's wife] – during each of which she told him she was sure Michael would support him. It was clearly emphatic enough to assure DC that would be the case.

No 10 had always assumed Gove had no leadership ambition and, as a friend of DC and George, he would never do anything to undermine them. I always questioned both assumptions.

No 10 had always assumed Gove had no leadership ambition and, as a friend of DC and George, he would never do anything to undermine them. I always questioned both assumptions

Gove told a lot of people he would be loyal to DC to the last, when he would switch his allegiance to George. Yet I once accompanied Gove and the PM on a visit to a school. Michael was preoccupied by what would happen if Boris got into Parliament: would he create an alternative powerbase from the backbenches? It was clear that DC was bored and he said: 'I don't know, that'll be something for George to deal with.'

Gove looked crushed. It struck me that he hated being dismissed as a potential leader by this casual comment, even though DC did not realise what he was doing.

Gove always hated the idea that some saw him as David Cameron's court jester.

The more I looked at him, the more everything he did appeared to be an act or a performance. His legendary politeness seemed forced, particularly for someone so skilled at dinner table character assassinations.

When DC moved him from Education to the post of Chief Whip, a job Gove had told him he had always wanted to do, Cameron thought he was protecting his friend, giving him an important role while preparing the ground for a later promotion.

Gove accepted, but appeared not to realise it meant a pay cut. Sarah Vine tweeted: 'A shabby day's work which Cameron will live to regret.' Were they really people who wanted the PM to succeed and did not harbour their own ambitions?

In a January Cabinet meeting, Gove made a Pollyanna-ish but oxymoronic speech about allowing ourselves to be a truly national party because we will have people arguing both sides of the case. One of my team leant over to me and whispered: 'Try schizophrenic.'

By the middle of February, hopes Gove would go for In fade. George had discussed with him the fact that Leave would lead to real damage for the economy. Gove said there would be 'scarring and burning' but that we would emerge from that situation and end up far more like Singapore.

Gove is confirmed as Out on the Friday that we reach a deal on the EU renegotiation. Given the news of his supposed friend and close political ally's decision, DC isn't angry but there is a tinge of sadness in his voice as he tries to make light of it: 'That's him off the Christmas card list.' He says Michael had always told him he'd let him know in person before others learned. In April, when we discuss Out Ministers trashing Government policies, specifically the NHS and the National Living Wage, DC thinks we need to do all we can to get the press to call out Gove. That would be fine, but he is doing no media, hiding I, suspect, from the question of whether he is the source of the Sun's 'Queen Backs Brexit' story.

When one of the newspapers suggests that Gove should be made deputy PM, DC says: 'Can you imagine him ever being left in charge of the country?'

I chat to George about whether Gove is setting himself to take over. George isn't sure Gove thinks he is up to it, 'But it is being thrust in his direction, so it may be hard to resist.'

At the beginning of June, Gove writes a questionable piece claiming that as Justice Secretary, 'I have experienced the frustration at our inability to refuse entry to those with a criminal record and even some who are suspected of terrorist links.'

DC is angry with him: 'I'm going to lose my temper and unleash one on these people on live TV soon.'

Some think Boris choosing to be a key figure in Leave was what did for us but Gove was crucial – mixing an intoxicating cocktail of brilliance and poison. When he stood as a Conservative leadership candidate, he was claiming that, contrary to everything he had always said, he did now think he could and should be Prime Minister. Crucially, he failed to realise that in acting as a political suicide bomber, one of his first victims would be himself.

For me Gove is an actor. He strikes a pose according to circumstances. He is capable of vision, wit and charm, and has a verbal dexterity second to none, but his fatal flaw was to be driven by a vaulting ambition and a preparedness to mislead. He is a tragic figure in the Shakespearean sense.

He let others down in a way that ultimately crushed himself.

David Cameron had to unleash the demons over Brexit: Former No10 chief CRAIG OLIVER on why the brutal referendum was inevitable

History tends to be written by the winners. That statement might be a cliche, but it doesn't make it any less true – or painful – for those who lost the EU referendum.

My book, Unleashing Demons, describes what it was like being at David Cameron's side throughout the campaign, and why, despite having thrown everything at it, he lost and had to leave Downing Street.

The account, serialised in today's Mail on Sunday, is based on my notes and a diary of being in key meetings with everyone from Barack Obama and Angela Merkel, to Boris Johnson and Theresa May. I didn't expect to tell the story so soon – because I hoped we'd win.

None of the details have been changed, however hard it was for me to read them back. Some who have already read the book believe it will make for even harder reading for senior politicians, a few of whom remain in high office, and many who don't. My intention isn't to expose or embarrass them. I simply want to put on record what actually happened during one of biggest political storms this country has ever faced.

The referendum was not just the biggest political decision for this country since the Second World War – it became a career opportunity for people hoping to become Prime Minister

The title of the book, Unleashing Demons, comes from a conversation I had with Cameron in his armour-plated car on the way to a speech.

Both of us believed a decision over Britain's membership of the European Union had been a slow train coming for a generation, and now it was arriving in the station on his watch.

The reasons were obvious: Nigel Farage's Ukip was on the rise, not just doing well in the 2014 European elections, but actually winning them. And scores of Conservative MPs were rebelling on anything and everything to do with Europe.

When asked, more than half the country believed that there needed to be a vote, partly because you had to be close to 60 to have taken part in the 1975 referendum on the then Common Market.

To put it another way, the issue had become a giant boulder blocking the road for the Government. Cameron could have tried to ignore it, or work around it, but had he not promised a referendum, the Conservative Party would almost certainly have demanded a leadership election and replaced him with someone who would.

It seemed inevitable on that car journey – but I still asked him for one reason why he shouldn't hold a referendum.

His answer was instant: 'You could unleash demons of which ye know not.' I thought it was a quote from Shakespeare or the Bible, but couldn't find it anywhere when I looked it up.

Those words were prophetic. But even Cameron did not foresee the extent of the civil war we encountered, with blood-letting on an epic scale.

The referendum was not just the biggest political decision for this country since the Second World War – it became a career opportunity for people hoping to become Prime Minister.

Some were overt, others more subtle. It felt painfully obvious as people who were close colleagues, even supposedly friends, were prepared to question Cameron's integrity, mislead the public, or do the bare minimum to help.

As the campaign continued, one journalist put his finger on it by writing: 'It sometimes feels as if we are trapped inside the tortured mind of a party that has… succumbed to madness.'

I'm frank about the mistakes we made and take my full share of responsibility for my part in them. It's important we have an honest discussion about what actually happened.

So what were those mistakes? The Remain campaign set too much store by what had become the closest thing to an iron law in politics – it's the economy, stupid!

Those words were coined by Bill Clinton's campaign manager James Carville during their first presidential campaign. They became a mantra for political parties around the world.

We were sincere in our belief, shared with countless experts, that the risk to the economy of leaving the EU should and would trump any other argument. We were wrong, and when the Leave campaign began to get real traction by focusing on immigration, we didn't have enough of an answer.

More to the point, what we believed was our great strength was also a weakness. We assembled a vast coalition, ranging from most of the Conservative Government, through the Labour, Lib Dem and Green parties, all believing we should stay in. But the reasons for remaining were different, resulting in confused messages.

Worse, the current leaders of the Left – Jeremy Corbyn and Nicola Sturgeon – seemed at best equivocal and sometimes actively hostile to our campaign. We also listened to the legion of analysts who said millions of people who had not voted for years would stay at home again.

Nearly three million of these 'non-voters' turned out, almost all of them for Leave. It was more than enough to ensure we lost. We should have done more to understand their concerns and persuade them why leaving the EU would be bad for them.

I also want to make clear that having made the Conservative Party electable again, David Cameron was a Prime Minister who was prepared to take on the big political issues of the age

I respect the result of the referendum and I do not believe there should be another. The people of this country voted to leave the EU by a clear margin on a high turnout.

As things stand, both sides are claiming they were right in their predictions about the impact of Brexit. Leavers say the economic disaster has been avoided, proven by some good economic news last week. Remainers point to the fact that our currency has lost ten per cent of its value, making things more expensive, and that business has pressed the pause button on investment.

We'll have a better idea after the Chancellor's autumn statement. But the true picture will only be clear after the two-year divorce process that begins when Theresa May applies to leave the EU next year.

I hope we were wrong – I want Britain to prosper – but remain seriously concerned. In the meantime, I'd like to provide a proper answer to the question: 'What were they thinking?'

I also want to make clear that having made the Conservative Party electable again, David Cameron was a Prime Minister who was prepared to take on the big political issues of the age.

He formed a coalition government to provide economic security when the country desperately needed it and he presided over a 'jobs miracle', resulting in millions more people being in work.

He reformed our schools and changed welfare to help make work pay. Gay couples being allowed to marry and the National Citizen Service are other parts of his legacy.

And yes, he confronted the EU question, showing leadership in taking on something that divided not just the Conservative Party, but whole communities.

He also showed dignity in being prepared to resign in the way he did when things went wrong.