Theresa May consistently refused to back David Cameron’s campaign to keep Britain in the EU leading to major tension between the pair, one of the ex-Prime Minister’s closest aides has claimed.

Ms May is accused of adopting a “sphinx-like” approach to the campaign that served her career well in the post-referendum chaos, despite her stance potentially doing untold damage to Remain’s hopes of victory.

The uncomfortable claims are made in a book by Mr Cameron’s former communications chief Sir Craig Oliver who tells how Ms May failed to support her leader on 13 separate occasions before finally and reluctantly coming “off the fence” for Remain following a dressing down from a “visibly wound up” Prime Minister.

The book also describes what the former Number 10 staffer calls Boris Johnson’s “flip-flopping” during the weekend he finally came out in support of Brexit.

A second book serialised today claims Mr Cameron branded Ms May “lily-livered” on the issue of immigration controls.

In his book, Unleashing Demons: The Inside Story Of Brexit, serialised in The Mail on Sunday, Sir Craig said Ms May’s unwillingness to declare her hand caused immense frustration in No 10.

Highlighting the benefits of her approach, he wrote: “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”.

Theresa May tells UN the UK will not turn inwards after Brexit vote

Sir Craig, handed a knighthood in Mr Cameron’s controversial resignation honours list, describes one conversation with Mr Cameron in January – six months before the referendum – after the then Prime Minister sought to sound out Ms May on the EU.

He wrote: “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.”

There was further consternation within No 10 when during a Cabinet discussion on the issue, Ms May did not join in, “playing her cards close to her chest”.

Sir Craig wrote: “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.”

The book tells how Ms May refused support so often that one aide branded her an “enemy agent”. Matters finally came to a head after a report in The Times warning that Mr Cameron faces “last minute opposition” from Ms May to his deal on EU reform.

“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,” Sir Craig wrote.

“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.”

A second book, All Out War, by The Sunday Times political editor Tim Shipman serialised in that paper, claims Mr Cameron branded Ms May “lily-livered” after she scuppered his plans for tough new immigration controls.

Mr Cameron wanted an “emergency brake” on migration as part of his EU renegotiation to help convince voters he would cut the numbers coming into the country.

But according to the book he was blocked by Ms May – who was not prepared to take on German chancellor Angela Merkel – and the then foreign secretary Philip Hammond, now Chancellor of the Exchequer.

It quotes one Cameron aide as saying: “Hammond spoke first and argued we just just couldn’t do something that would receive an immediate raspberry in Europe. Theresa said very, very little, and simply said that we just couldn’t go against Merkel.”